Notes GetLogger injected ILogger - NLog/NLog.Extensions.Logging GitHub Wiki
Some important notes:
- The configuration in
LogManager.Configuration
will be used forLogManager.GetLogger
/LogManager.GetCurrentClassLogger
and injectedILogger<T>
- When using "Microsoft.Extensions.DependencyInjection", the injected
ILogger<T>
is preferred overLogManager.GetLogger
/LogManager.GetCurrentClassLogger
- When using the injected
ILogger<T>
, you need to enable the integration withbuilder.AddNLog
(that's in your code example).