Dependency on Log4Net Logger and Retrieve Logger by Caller Type using Castle Windsor
问题 I have a thin wrapper around log4net and I am trying to use the type of the calling class to get a logger from log4net.LogManager by using Castle.Windsor . public class Foo: IFoo { private readonly ICommonLog _logger; public Foo(ICommonLog logger) { _logger = logger; } public void FooBar() { _logger.Info("Enter FooBar Method"); } } public class CommonLog : ICommonLog { private readonly log4net.ILog _logger; public CommonLog(Type loggerType) { _logger = log4net.LogManager.GetLogger(loggerType)