-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add support for enricher constructor dependency injection #18
Comments
Thanks for the note. Perhaps this would fit under the https://github.com/serilog-web projects, somewhere? So far, for .NET Core, middleware has been working pretty well, though - e.g. https://blog.getseq.net/smart-logging-middleware-for-asp-net-core/ |
how about inject IServiceCollection
|
|
@nblumhardt |
Folks watching this thread, check out the |
updated link: Request Logging |
You can now |
In .NET core, Microsoft got rid of good old HttpContext.Current. You now have to get at it by injecting IHttpContextAccessor into your class constructor that needs to read various http header values. It would be nice if we could inject IHttpContextAccessor into our constructor for enriching values based upon the current http request context (yes, this is possible via middleware but P.I.T.A.). Enricher properties of interest would be various request headers and the user name for the current request.
The text was updated successfully, but these errors were encountered: