Last post Jul 02, 2018 05:40 AM by Nan Yu
Jun 29, 2018 08:41 PM|neoaguil17|LINK
I followed the link: https://www.c-sharpcorner.com/blogs/sample-logging-using-nlog to setup nlog in my aspnet app.
I would like to change a configuration in NLog.config to enable or disable the logging
How I can do that?
Jul 01, 2018 05:31 PM|Khanna Gaurav|LINK
Set globalThreshold to Off
<nlog globalThreshold="Off" />
Jul 02, 2018 05:40 AM|Nan Yu|LINK
If you want to reconfigure NLog programmatically , you can manipulate the rules in memory :
If you want to turn off Logging from Nlog.config , you can use use <nlog globalThreshold="Off" /> as @Gaurav shows . That is same as setting LogManager.GlobalThreshold = LogLevel.Off .