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

Convert this package into a pure metapackage, so that UseSerilogRequestLogging() can be made available without any other dependencies #266

Open
mike-schenk opened this issue Sep 24, 2021 · 7 comments

Comments

@mike-schenk
Copy link

<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />

There is no code in the project that depends on the Serilog.Sinks.File package.

This causes the resulting Serilog.AspNetCore NuGet package to carry along an unnecessary dependency.

@nblumhardt
Copy link
Member

Thanks for the note, Mike.

This package was originally a metapackage with no substantial code of its own; we might consider a refactor now that there's more implementation here, but there's a usability trade-off: even the primary overloads of UseSerilog() and ReadFrom.Configuration() come from other packages and aren't directly relied upon by the code in this package.

I'd be inclined to leave this for now, but extracting RequestLoggingMiddleware into a package of its own (e.g. Serilog.AspNetCore.Http) would also seem to be a reasonable path to consuming the functionality pulled in here in a more selective manner 🤔

@sungam3r
Copy link
Contributor

sungam3r commented Oct 4, 2021

Relates to #127

@GraemeF
Copy link

GraemeF commented Dec 14, 2021

This is starting to cause problems - the unnecessary dependencies are becoming outdated which can lead to version downgrade errors when building (especially when targeting linux, it seems), and the workaround is to add direct dependencies to the later versions of these implicitly-included packages from our projects. Feels very wrong, as our projects don't use these packages at all! 😄

@sungam3r
Copy link
Contributor

#127 (comment)

@nblumhardt
Copy link
Member

@GraemeF thanks for dropping by!

Still open to extracting the middleware/other implementation code from this package, to allow consumption of the bundled parts. Is anyone keen to analyze what would actually get moved/propose some package names for it to move into?

@sungam3r
Copy link
Contributor

In #127 I proposed to remove 5 packages. Just remove, without making any new meta-packages. Any who needs specific sinks may just drop in sink package into project, that's all.

@nblumhardt
Copy link
Member

I'm not keen on dropping the dependencies here, not least because of the downstream breakage, but also because this creates one more barrier to adopting Serilog: the default .NET web SDK includes the console logger provider for MEL, there's no extra step to install it; the default .NET web SDK enables JSON config support ... etc. etc.

Apart from the logging middleware in this package, everything else is already in fine-grained packages. If we extract the logging middleware to its own package, referenced from this one, then it's easy to just install Hosting, Configuration, the middleware package, and whatever other sinks you require. Let's push this one forward :-)

@nblumhardt nblumhardt changed the title Reference to Serilog.Sinks.File is unnecessary Convert this package into a pure metapackage, so that UseSerilogRequestLogging() can be made available without any other dependencies Jan 19, 2022
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

4 participants