views:

23

answers:

1

hi,

I have a C# Win Form application and in each class i get the logger like this:

private static readonly ILog Log = LogManager.GetLogger("ApplnLogger");

I configured in my app.config to log messages at info level and above.

Now when a issue is reported i would like to set the logger level to debug so that i will have information in log file necessary for debugging the issue.

How do I set the logger level to debug overriding the config level of INFOwithout having to restart my win form application?

+1  A: 

Check out ConfigureAndWatch

Basically, you tell your program to watch the configuration file for changes. So, if you edit this file, Log4net will automatically use the new settings without you having to restart your application.

sgmoore