In NLog, is it possible to use layouts to define the log level?
问题 I would like to use Layouts in NLog to be able to change the minimum log level using an external variable : <nlog> <variable name="loglevel" value="Debug"/> <targets> <target ... /> </targets> <rules> <logger name="*" minlevel="${loglevel}" writeTo="LogFile" /> </rules> </nlog> After starting NLog, all log levels (eg : Tracing, Debug, Info, ...) are set to false which indicate NLog failed to parse minlevel attribute properly. The NLog layout feature seems to works with target attributes only.