-
Notifications
You must be signed in to change notification settings - Fork 207
Remove unnecessary dependencies #127
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
Conversation
Thanks Ivan! This is #110 - moving this package towards a "batteries included" approach, since the core It would be interesting to know which features of Serilog.AspNetCore you're using, so that we can evaluate whether this is the optimal factoring. Cheers! |
Wow! I could not even imagine that it was intended. I highly recommend not including such dependencies. It's like shooting yourself in the foot. With the same success, you can turn on a bunch of other sinks/formatters/appconfigs/etc. in the hope that they will be useful to someone. But in fact, only version conflicts will arise when the consumer uses a package of another major version. These are all spurious dependencies.
In this case, you can make a separate package and name it like For some consumers, this concern actually turns into problems of versioning dependencies. And the other part simply does not use this "ballast". You have already done sample projects with good examples. No need to mix. |
I use |
Thanks for the reply! As you'd know, the Serilog packages are all very fine-grained, for many of the reasons you point out. Unfortunately, something resembling a meta-package is needed if we're going to meet the ease-of-setup expectations set by Microsoft.Extensions.Logging/ASP.NET Core, which includes console and debug logging by default.
Sorry, I meant which features from this package? Since the core logging adapters and None of this set in stone, of course! It will be interesting to see whether the batteries-included approach here reduces some of the support around this package, or ends up increasing it. We can definitely re-evaluate and change direction if needed. |
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should in any case be able to get rid of these two 👍
@@ -205,7 +205,7 @@ Finally, pass the provider collection into `UseSerilog()`: | |||
|
|||
Providers registered in _Startup.cs_ with `AddLogging()` will then receive events from Serilog. | |||
|
|||
**Using iniline initialization:** | |||
**Using inline initialization:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, nice catch 😅
When I read this comment, I realized that this is what I needed. But when I opened the source code, I was disappointed. It uses Relates to #126 |
Ah, thanks for the follow-up. This is a point-in-time issue, I think, since in .NET Core 3.0, startup will be |
Yes, but it will be only in netcoreapp3.0 and netstandard2.1. Still need to wait for the release. For netstandard2.0 there is no such unification. |
Thanks for the reply. It sounds like there's a bit of a compromise necessary for the time being on |
3.0 is now available, I think that's the way forwards. Cheers! |
I think that these dependencies were added unintentionally due to sample projects that reference the main package.
In fact, only two are enough:
