We are using NLog in our .net 5.0 Web API and feel like log levels are set in multiple places. Is there a way we can configure nLog to use the app settings and ignore nLog.config log levels?
nlog.config:
<rules>
<logger name="*" levels="Trace,Debug,Info,Warn,Error,Fatal" writeTo="NLogTarget"/>
</rules>
AppSettings.json:
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Debug"
}
}
Thanks in advance.