Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing nLog logging level in Production

Tags:

nlog

What's the best practice for changing the logging level for nLog in a production environment. The only way I can change it is to modify the NLog.config file, and then recycle the app pool. Is that how it should be done?

Thanks,

Chris

like image 548
Mister Epic Avatar asked Jan 25 '26 04:01

Mister Epic


1 Answers

If you want to change logging configuration, without restarting application, you should set autoReload="true".

NLog.config file:

<nlog autoReload="true">
   ...
</nlog>

More: https://github.com/nlog/NLog/wiki/Configuration-file#wiki-automatic-reconfiguration

like image 192
oakio Avatar answered Jan 26 '26 23:01

oakio