main
1using System;
2using System.IO;
3using Gorilla.Commons.Infrastructure.Logging;
4using Gorilla.Commons.Infrastructure.Reflection;
5using log4net;
6using log4net.Config;
7
8namespace gorilla.commons.infrastructure.thirdparty.Log4Net
9{
10 public class Log4NetLogFactory : LogFactory
11 {
12 public Log4NetLogFactory()
13 {
14 XmlConfigurator.Configure(PathToConfigFile());
15 }
16
17 public Logger create_for(Type type_to_create_logger_for)
18 {
19 return new Log4NetLogger(LogManager.GetLogger(type_to_create_logger_for));
20 }
21
22 FileInfo PathToConfigFile()
23 {
24 return new FileInfo(Path.Combine(this.startup_directory(), "log4net.config.xml"));
25 }
26 }
27}