diff options
| author | mo <mo.khan@gmail.com> | 2018-11-04 15:22:16 -0700 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2018-11-04 15:22:16 -0700 |
| commit | 5ee1f55497a4e30322a56f133f897ecde1612967 (patch) | |
| tree | bf544e0879234c3623869627d8786776cb19b8e9 /src/Notepad/Infrastructure/Logging/Log4NetLogging/Log4NetLogFactory.cs | |
Diffstat (limited to 'src/Notepad/Infrastructure/Logging/Log4NetLogging/Log4NetLogFactory.cs')
| -rw-r--r-- | src/Notepad/Infrastructure/Logging/Log4NetLogging/Log4NetLogFactory.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Notepad/Infrastructure/Logging/Log4NetLogging/Log4NetLogFactory.cs b/src/Notepad/Infrastructure/Logging/Log4NetLogging/Log4NetLogFactory.cs new file mode 100644 index 0000000..0784a13 --- /dev/null +++ b/src/Notepad/Infrastructure/Logging/Log4NetLogging/Log4NetLogFactory.cs @@ -0,0 +1,20 @@ +using System;
+using System.IO;
+using log4net;
+using log4net.Config;
+
+namespace Notepad.Infrastructure.Logging.Log4NetLogging {
+ public class Log4NetLogFactory : ILogFactory {
+ public Log4NetLogFactory() {
+ XmlConfigurator.Configure(PathToConfigFile());
+ }
+
+ public ILogger CreateFor(Type typeToCreateLoggerFor) {
+ return new Log4NetLogger(LogManager.GetLogger(typeToCreateLoggerFor));
+ }
+
+ private FileInfo PathToConfigFile() {
+ return new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config.xml"));
+ }
+ }
+}
\ No newline at end of file |
