Repository navigation
Fix missing handled tag when events are logged via an ASP.NET Core pipeline logger - #1284
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1284 +/- ##
==========================================
+ Coverage 81.83% 82.54% +0.70%
==========================================
Files 212 213 +1
Lines 7075 7085 +10
Branches 1396 1399 +3
==========================================
+ Hits 5790 5848 +58
+ Misses 845 801 -44
+ Partials 440 436 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Will have to add Serilog as a dependency of the AspNetCore project then. And NLog. This will get ugly. |
…on to mark events as unhandled
|
Okay, got a proper candidate now. Ended up using an exception processor instead, just to cover all the different loggers in one move, and also added an integration test to the Serilog tests repo. A lot of boilerplate there to make it work, but it seems better than adding Serilog specific integration tests to the AspNetCore test project (might also need tests for this also for NLog and Microsoft.Extensions.Logging?) |
|
Thanks for the PR. Hopefully @lucas-zimerman and/or @SimonCropp can help out with the review here |
We could just make it in Though, will still need to override the fake anyway for the custom logging config. |
|
|
||
| Assert.Equal("Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware", LastEvent?.Logger); | ||
| Assert.Same(expectedException, LastExceptionFilter.LastException); | ||
| Assert.Collection(LastEvent.SentryExceptions, x => Assert.False(x.Mechanism?.Handled)); |
There was a problem hiding this comment.
can u fix the GH action checks
There was a problem hiding this comment.
This works locally, I wonder why it breaks on GH Actions. I've changed the tests, will see if it works correctly now.
Co-authored-by: LucasZF <lucas-zimerman1@hotmail.com>
|
@kanadaj Thanks for the PR. |
Fixes #1283
This is a draft fix for an issue with the Serilog sink that causes issues not to be marked as handled.
Realistically this should have a test written for it, but I have no idea how to mock the entire ASP.NET Core pipeline, and testing this would require that. Also not entirely sure if this is the best way to handle this. Maybe an event processor could also do this instead?
@bruno-garcia @lucas-zimerman thoughts?