altering config file programatically

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

altering config file programatically

markr-2
Hello,

I'm using NLog with ASP.NET 2.0 and a config file named "web.nlog". I would like to be able to adjust the logging targets programatically and then save the configuration back out again.

It appears that XmlLoggingConfiguration can read and parse configuration info from a file easily enough, but is there a way to save it back out again?

Sorry if I'm overlooking something obvious!

- MR
Reply | Threaded
Open this post in threaded view
|

Re: altering config file programatically

Jarek Kowalski
Administrator
There's currently no way to dump the configuration back to XML, but it's definitely doable. It would involve a lot of reflection and probably some tweaks to method/properties visibility, but I'd be happy to accept a patch that adds this functionality.

Jarek
NLog Blog