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

Should NLog fully replace Microsoft Logger in Core 2.0 #280

Closed
alexandrejobin opened this issue Apr 19, 2018 · 3 comments
Closed

Should NLog fully replace Microsoft Logger in Core 2.0 #280

alexandrejobin opened this issue Apr 19, 2018 · 3 comments
Labels

Comments

@alexandrejobin
Copy link

alexandrejobin commented Apr 19, 2018

I was playing with ASPNet Core 2.0 and NLog this week and faced the problem that even if nlog is configured to log everything (trace, debug, etc), nlog will only receive what is configured with Microsoft Logger. By default, Microsoft logger only send messages with level Information and up. It's seems to have confused a lot of people here (#167, #171, #128, #175, #166, #234, #238, etc).

Is there any talks about replacing the Microsoft Logger entirely with nlog instead of putting nlog behind it? Serilog is replacing the Microsoft Logger completly and it seems more natural in my opinion. Otherwise, it is like saying that nlog is a provider for Microsoft Logger but you need to configure 2 frameworks to make it work correctly so it might be confusing.

So instead of the actuel implementation flow where the LoggerInformation is responsable of dispatching the log by following his own rules and then follow the nlog rules:

Microsoft.Extensions.Logging.Logger -> Microsoft.Extensions.Logging.LoggerInformation -> NLog.Extensions.Logging.NLogLogger

nlog would be fully responsable of what he is doing with this flow :

Microsoft.Extensions.Logging.Logger -> NLog.Extensions.Logging.NLogLogger

So you need to choose between Microsoft Logger OR NLog but not both. Any thoughts?

@304NotModified
Copy link
Member

304NotModified commented Apr 19, 2018

Is there any talks about replacing the Microsoft Logger entirely with nlog instead of putting nlog behind it?

yes, but there are downsides also. Replacing = create custom factory, and that is: #235

Serilog is replacing the Microsoft Logger completly and it seems more natural in my opinion

it has it's pros and cons, see also #235

I was playing with ASPNet Core 2.0 and NLog this week and faced the problem that even if nlog is configured to log everything (trace, debug, etc), nlog will only receive what is configured with Microsoft Logger. By default, Microsoft logger only send messages with level Information and up. It's seems to have confused a lot of people here (#167, #171, #128, #175, #166, #234, #238, etc).

Agree on that

@304NotModified
Copy link
Member

maybe continue on #235 and close this one, OK?

@alexandrejobin
Copy link
Author

alright!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants