This seems like it would be an easy thing to do and would be a common desire, but I'm curious about a good way to do it. I would like to write the minlevel for a specific logger to its log file upon startup. I am routinely looking at logs and trying to remember how I left the log level for that application without having to dig up the NLog.config file. I would like a log entry that would look something like this:
2018-08-03 09:38:23.7975 | INFO | Starting with Log Level set to: Debug
I can see that I should be able to access the LoggingConfiguration as such:
NLog.LogManager.Configuration
But how do I access the rules and minlevel from that? Any other suggestions? If you can suggest some good NLog resources in addition to the NLog Tutorial, I would appreciate it.
logger.IsTraceEnabled
is true, if not, check ifIsDebugEnabled
is true, if not, check ifIsInfoEnabled
...? – user47589