-
-
Notifications
You must be signed in to change notification settings - Fork 226
fix: Serilog integration captures structured log when event with exception has been captured
#4691
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
fix: Serilog integration captures structured log when event with exception has been captured
#4691
Conversation
… has been captured
|
@sentry review |
| var template = logEvent.MessageTemplate.Text; | ||
| var formatted = FormatLogEvent(logEvent); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
-addedBreadcrumb
+addedBreadcrumbForExceptionto go in line with the Hub.AddBreadcrumbForException method, which is implicitly adding the Breadcrumb when an Exception is present.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version6 #4691 +/- ##
===========================================
Coverage ? 73.18%
===========================================
Files ? 480
Lines ? 17422
Branches ? 3437
===========================================
Hits ? 12751
Misses ? 3821
Partials ? 850 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| ### Fixes | ||
|
|
||
| - The `Serilog` integration captures _Structured Logs_ (when enabled) independently of captured Events and added Breadcrumbs ([#4691](https://github.com/getsentry/sentry-dotnet/pull/4691)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: 6.0.0 vs 5.16.3
Do we want to publish this fix in a 5.16.3 patch release,
or is it fine to include in 6.0.0 as it's just a week away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we plan to GA structured logging in version 5 of the SDK right? So doesn't make sense to backport the fix for this.
Serilog integration captures structured log when event with exception has been captured
jamescrosswell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy - thanks @Flash0ver !
Fixes #4654
When the
Serilogintegration has captured an Event with an Exception, thenThis fix keeps the prevention of adding an additional Breadcrumb when an Event with an Exception has implicitly already added a Breadcrumb, but will still produce a Structured Log message (if enabled).
When an Event without an Exception does not implicitly add a Breadcrumb we still continue to explicitly add a Breadcrumb, while continuing to capture a Structured Log.