autoReload if configSection is shared in between app.config

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

autoReload if configSection is shared in between app.config

bobby_d_
Hi,
I would like to simplify my NLog configuration little bit. What I have now is nlog configSection in app.config for every project interested in logging, which is a pain if it comes to changing target or logging level for all of them. To improve maintainability I moved NLog section to configSource and all my app.configs are now pointing to the same configSource, so I am sharing one configuration in between projects. It works fine apart of the autoReload feature – changes doesn’t get picked up. This is tested on windows service and .exe. Windows service is the first to load the configuration and then launches .exe processes. .exe processes doesn’t see the change in config, only after they're re-launched.

Using NLog.config or NLog.dll.nlog placed in the same fo;der as nlog.dll is not really an option because I want to keep the option of custom logging settings per project, if needed and on runtime.      

Could you please advise me on how to refresh the config for both( or multiple) projects ?  
Reply | Threaded
Open this post in threaded view
|

Out of Office AutoReply: autoReload if configSection is shared in between app.config

ian.clegg
Im currently out of the office until 22nd August 2011.
Please contact G 1ST IT&S FrontOfficeFramework (G1STIT&[hidden email]) for assistance
Reply | Threaded
Open this post in threaded view
|

Re: autoReload if configSection is shared in between app.config

Jarek Kowalski
Administrator
In reply to this post by bobby_d_

You can use include tag to reference common targets and rules.

Now you can put minimal project-specific configuration in app.exe.nlog or app.exe.config

NLog Blog