Skip to content

Conversation

Flash0ver
Copy link
Member

@Flash0ver Flash0ver commented Aug 21, 2025

Changes

Add Serilog integration to Sentry Structured Logging.

Docs

Dogfooding

  • getsentry/symbol-collector -> SymbolCollector.Server

@Flash0ver Flash0ver self-assigned this Aug 21, 2025
@Flash0ver Flash0ver added Serilog .NET Pull requests that update .net code Logs labels Aug 21, 2025
Copy link
Contributor

github-actions bot commented Aug 21, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against cdf0318

@Flash0ver
Copy link
Member Author

@sentry review

@Flash0ver Flash0ver marked this pull request as ready for review August 22, 2025 00:08

private void CaptureStructuredLog(IHub hub, LogEvent logEvent, string formatted, string? template)
{
var traceHeader = hub.GetTraceHeader() ?? SentryTraceHeader.Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the ParentSpanId required in the protocol for StructuredLogging? An empty SpanId probably isn't that useful otherwise eh?

Copy link
Member Author

@Flash0ver Flash0ver Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ... it's an optional "Default Attribute" ... the trace_id is required.

Oops ... I made this mistake in the Sentry-SDK and Microsoft.Extensions.Logging integrations, too.

I'll create a follow-up PR to fix this issue in all integrations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow-up for both the SDK-Logger and the Microsoft.Extensions.Logging integration: #4565

@Syed-RI
Copy link

Syed-RI commented Oct 2, 2025

@Flash0ver we we have to add Sentry.Serilog package and add that sink? I cant find it in the doc (told you I'm the idiot :P)

This was referenced Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Logs .NET Pull requests that update .net code Serilog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants