You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm guessing that most new application will go for Microsoft.Extensions.Logging as their ILogger-abstraction.
This means that one only setup NLog during startup-configuration, so it can be combined with Microsoft.Extension.Logging with these usings:
using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;using NLog;
Now one will get a compiler error if trying to use an ILogger during startup-configuration, because there is one in NLog-namespace and Microsoft.Extensions.Logging-namespace. To avoid issues then on can use var in var logger = loggerFactory.CreateLogger("Startup");
By moving NLog-Setup-extension-methods into NLog.Config-namespace, then one can do this, and not be hit on the head by the compiler:
using Microsoft.Extensions.DependencyInjection;using Microsoft.Extensions.Logging;using NLog.Config;
The text was updated successfully, but these errors were encountered:
I'm guessing that most new application will go for Microsoft.Extensions.Logging as their ILogger-abstraction.
This means that one only setup NLog during startup-configuration, so it can be combined with Microsoft.Extension.Logging with these usings:
Now one will get a compiler error if trying to use an ILogger during startup-configuration, because there is one in NLog-namespace and Microsoft.Extensions.Logging-namespace. To avoid issues then on can use
var
invar logger = loggerFactory.CreateLogger("Startup");
By moving NLog-Setup-extension-methods into NLog.Config-namespace, then one can do this, and not be hit on the head by the compiler:
The text was updated successfully, but these errors were encountered: