You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, this library exposes a UseSerilogRequestLogging method to be used inside the Configure method, but does not expose a method to add the necessary registrations to the container to make it work properly. Usually, "features" added in Configure should have an equivalent AddX extension to be used inside ConfigureServices so that all required dependencies are registered.
I understand the UseSerilog on IHostBuilder includes those registrations, but that happens somewhere else. Perhaps UseSerilog could call into the same method to register the needed classes.
Describe the solution you'd like
Add a new extension method for IServiceCollection to register the needed types for the request logging logic (for example, DiagnosticContext)
Describe alternatives you've considered
Calling UseSerilog on the IHostBuilder does register the necessary dependencies, but it forces changes on Program.cs for cases where one wants to configure the logger inside Startup.
The text was updated successfully, but these errors were encountered:
Hi @julealgon - thanks for the suggestion! Post-.NET 5.0 I'll take a look at this - in the meantime I think we will want to stay close to the host builder in the expectation that host-level logging is going through some churn and we may need to hook into it more deeply in the future.
Is your feature request related to a problem? Please describe.
Currently, this library exposes a
UseSerilogRequestLogging
method to be used inside theConfigure
method, but does not expose a method to add the necessary registrations to the container to make it work properly. Usually, "features" added inConfigure
should have an equivalentAddX
extension to be used insideConfigureServices
so that all required dependencies are registered.I understand the
UseSerilog
onIHostBuilder
includes those registrations, but that happens somewhere else. PerhapsUseSerilog
could call into the same method to register the needed classes.Describe the solution you'd like
Add a new extension method for
IServiceCollection
to register the needed types for the request logging logic (for example,DiagnosticContext
)Describe alternatives you've considered
Calling
UseSerilog
on theIHostBuilder
does register the necessary dependencies, but it forces changes onProgram.cs
for cases where one wants to configure the logger insideStartup
.The text was updated successfully, but these errors were encountered: