What about Reloading LogStrategy configuration

Sep 23, 2008 at 5:15 PM

Im using the Log4Net strategy. I want to load the configuration from XML and to be able to reload it upon request.

I've been thinking about the right to implement it. I think the right way will be to add two method to the ILogStrategy: LoadConfigurationFromXML, ClearConfiguration.

Each Strategy should implement this methods. if a specific strategy do not approve XML configuration it can throw NotImplementedException.

What do u think ? what other options can you think of ?
Sep 24, 2008 at 3:27 PM

Do you wish to reload the Log4Net configuration or the Clog Log4NetStrategy configuration?
Perhaps you could tell me a little bit more about the problem you are trying to solve so that I can assist you better.

Just a comment on the second last line of your message...You might want to have a property rather than throwing an exception to signify whether a strategy can reload its config.

Cheers, Daniel
Sep 28, 2008 at 2:16 PM
Edited Sep 28, 2008 at 2:58 PM
Hi Daniel, Right now Im trying to deal with two issues: 1) Loading Log4Net configuration from XML (or any other strategy). I would like to have in the strategy interface a method that would allow me to do that. Am I missing something or should the implementation should be something like that. 2) Reloading configuration in run time. Actually I want to change the log level of a certain logger at run time, but it seems to appropriate to enable reloading of all the configuration.Again, like in the previous issue, I would like to reload it from the XML configuration file. So, I would like to reload the log4Net config as you understnad. Hope I made the problem clearer. Waiting for your answers, Liron.