Code Coverage by Clover.NET

Is it possible to update logging config on a running application?

View: New views
2 Messages — Rating Filter:   Alert me  

Is it possible to update logging config on a running application?

by Waveslam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi
Sorry for the n00b question but I am evaluating NLog for use in our company and one of the questions that has been asked is whether it is possible to modify the logging target config and apply the changed settings without restarting the application? For example, if an app suddenly starts behaving strangely, can I modify the minlevel setting of a file target to now include debug level logging output and have this changed setting take effect (i.e have it start logging debug entries to file) without restarting the application?
Cheers
Brett

Re: Is it possible to update logging config on a running application?

by Boersnoes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, this is possible.
Check http://www.nlog-project.org/help/config.html (scroll to Configuration parameters).
The magic is done by adding the autoReload="true" attribute in your config file’s nlog node.

I haven’t tried it yet, but it should be possible.

Boris