-
Notifications
You must be signed in to change notification settings - Fork 165
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
Use LoggerFactory instead of LoggerProvider #235
Comments
also related: NLog/NLog.Extensions.Logging#202 |
pros
cons
My opinion is that if you want to register a new provider in the LoggerProvider, you must fully follow the way it work. It must be driven only by the Logger configuration. Since that nlog is not a real provider for the Logger but a full logging framework, I think it make sens that nlog should take full control of the logging system. Why choose AddConsole and AddDebug when nlog already have targets for them? |
Thanks! I think you're right. It would be nice if we could support both (referring to This is a breaking change, thus I think it should be V5 if applied |
When you call UseNLog, maybe we can pass a parameter to tell if you want to use it as a full framework or a provider for Logger? |
that's an option, but maybe also confusing if we have 2 modes. |
So what are you suggesting? You've said that you wanted to support both :) |
The See also aspnet/Logging#420 |
We've had some experience taking the The user experience has worked out well in most respects, there's minimal semi-compatible gunk to work around, and no perf/complexity penalty to suffer choosing Serilog (via the factory) vs. the compromises we'd be stuck with if we'd stayed on the provider track. I'd definitely take this route again, if we were to face the decision a second time. There are a few places where there are gaps, but hopefully these will close over time if plugging in at the factory level becomes more commonplace. If you need any details of how things have come out for Serilog please drop us a line! :-) |
Just some random noise. It is only While Looks like https://www.nuget.org/packages/Serilog.Extensions.Logging/ |
@snakefoot Serilog.AspNetCore has a dependency on Serilog.Extensions.Logging, so the latter will always be ahead in download counts :-) It's also much older, so there's a lot of outdated documentation/blog posts/tutorials out there that still point to the older package. Cheers! |
If wanting Serilog to live along with Azure Application Logging, then one will have to step around Serilog.AspNetCore. Because of the LoggerFactory-swap-trick: serilog/serilog-aspnetcore#60 |
Serilog is now doing investigation on implementing their own custom version of LoggerFactory with full support of external LoggerProviders. Special headaches might arrive in supporting the same new features that arrives with the official LoggerFactory for new platform versions, while still trying to support older platform versions (Ex. |
Resolved by #657 that adds the option |
current pro and cons:
pro
con:
The text was updated successfully, but these errors were encountered: