NLog.Web
NLog.Web copied to clipboard
Port AspNetBufferingWrapper to ASP.NET Core
From https://github.com/NLog/NLog/issues/2806
Port to middleware.
Current docs: https://github.com/nlog/nlog/wiki/AspNetBufferingWrapper-target
Any progress to this?
Nope. This isn't started. Do you need it?
We'd love to use this in our projects since we're creating lots of log items and don't want to create a new connection everytime we write our log to Elastic Search. (We currently use the elastic search target)
Feel free to create a PR 👍
https://docs.microsoft.com/en-us/aspnet/core/migration/http-modules?view=aspnetcore-2.2
Please use the thumbs up in the start post. Thanks!
Sending a +1 message (and notification) every minute won't help implementing this...
Guess this should be followed for implementing this: https://docs.microsoft.com/en-us/aspnet/core/migration/http-modules?view=aspnetcore-5.0
Source code of the current wrapper: https://github.com/NLog/NLog.Web/blob/master/src/NLog.Web/Targets/Wrappers/AspNetBufferingTargetWrapper.cs
@jdpapiero @jenunez @david-pierola-incontact @muchachopolo @ferd-altamirano @marcos-bustos-nice @antonio-schlappa-incontact @milton-ballon-incontact @Baklap4 @justhoma
If I create middleware for this, so this will work in ASP.NET Core, could one of you please test it? I will create a pre-release package then.
Sure. I will. @304NotModified
I submitted a PR for review for this
Pre-Release from #816 is available here:
https://ci.appveyor.com/project/nlog/nlog-web/builds/44420816/artifacts
If people want to help test/verify/review the direction. The following middleware must be enabled:
app.UseMiddleware<NLog.Web.NLogBufferingTargetWrapperMiddleware>();
@jdpapiero @jenunez @david-pierola-incontact @muchachopolo @ferd-altamirano @marcos-bustos-nice @antonio-schlappa-incontact @milton-ballon-incontact @Baklap4 @justhoma
Thank you snakefoot for the pull request to close this issue.
https://www.nuget.org/packages/NLog.Web.AspNetCore v5.2.1 has been released with support for AspNetBufferingWrapper
on ASP.NET Core via NLogBufferingTargetWrapperMiddleware
.
- https://github.com/NLog/NLog/wiki/AspNetBufferingWrapper-target
Thanks to @bakgerman that made it happen.