Trying to override LogLevel in Nlog Configuration using environment variable and it does not work: e.g
I know this is a little more wordy, but maybe it works, until someone creates a proper fix:
Btw. curious why your original question has it as less-than instead of greater-than. Would expect when having configured LOG_LEVEL to Warn, then it should log all warnings or worse.
The above example will have a performance hit because lookup of environment-variables are not fast. NLog 4.6.8 introduces the cachedSeconds-features, that reduces the performance hit:
NLog 4.6.8 also makes it easier to use Layout in LoggingRules, but one is still required to make an explicit call to LogManager.ReconfigExistingLoggers() to activate.
See also: https://github.com/nlog/NLog/wiki/Filtering-log-messages#semi-dynamic-routing-rules