0

I am using the following code from castle windsor documentation. I can't figure out how to pass in my configFile on my bootstrapper container installer that installs this installer.

 public void Install(IWindsorContainer container, IConfigurationStore store)
    {
        container.AddFacility<LoggingFacility>(f => f.UseLog4Net("NameOfConfigFile"));
    }
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30

2 Answers2

0

By default I believe it will use a logging.config on the root of the project. Do you still need to use something more customized than that?

hammett
  • 705
  • 4
  • 13
  • UseLog4Net method has an overload that accepts string configFile name to use, I am asking how to pass it in? because diff clients consuming my library will have diff log4net config files. – OutOFTouch Nov 04 '12 at 06:06
  • @rarouš What do you mean it is a deployment issue? Please clarify. – OutOFTouch Nov 05 '12 at 13:38
  • I am trying to figure out how to pass the name/path of the Log4Net config file to the Castle.Facilities.Logging.LoggingFacility.UseLog4Net during container install. Merlyn Morgan-Graham answer here is close to what I am asking http://stackoverflow.com/questions/2297282/logging-with-castle-facilities-logging-and-log4net – OutOFTouch Nov 05 '12 at 14:07
  • You don't have to change config file names in app, you just deploy correct config into file with specified name. – Aleš Roubíček Nov 06 '12 at 07:44
  • @rarouš I don't think you understand what I am asking. I am asking how to dynamically pass in the log4net config file to UseLog4Net when my installers are installed. – OutOFTouch Nov 06 '12 at 14:50
0

The only way I have been able to do this is by newing up my installer and passing in the NameOfConfigFile and in the constructor of my installer setting a private instance field to this value.

_bootStrapContainer = new WindsorContainer().Install(new LoggerInstaller(configPath));
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30