I\'m trying to figure out what the right patter and usage of log4net is with a dependency injection framework.
Log4Net uses the ILog interface but requires me to ca
Another way of doing it would be to wire up the log4net ILog interface container registration sequence like this: (using Castle in an ASP.NET context below as an example)
container.Register(Component.For().LifeStyle
.PerWebRequest.UsingFactoryMethod(() => LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType)));
and just constructor-inject ILog whenever you need it.