Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all fluent configuration extensions into NLog.Config-namespace to avoid conflicts #4553

Open
snakefoot opened this issue Sep 8, 2021 · 0 comments

Comments

@snakefoot
Copy link
Contributor

snakefoot commented Sep 8, 2021

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant