I\'m trying to get log4net integration for Castle Windsor working. I wrote my class with an public property of type ILogger
and took the configuration in my app
Following recent Castle conventions (correct me if wrong), I have solved it this way:
using Castle.Facilities.Logging;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
namespace EVRM.Aspects.Container.Installers
{
public class LoggingInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.AddFacility(f => f.UseLog4Net(System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile));
}
}
}
I have simply adapted the method provided here: http://docs.castleproject.org/Windsor.Windsor-Tutorial-Part-Five-Adding-logging-support.ashx
and used the overload of UseLog4Net() that accepts an configuration file parameter.