fix(serilog): set category.name for structured logs from SourceContext#5396
Closed
Shaurya2k06 wants to merge 1 commit into
Closed
fix(serilog): set category.name for structured logs from SourceContext#5396Shaurya2k06 wants to merge 1 commit into
Shaurya2k06 wants to merge 1 commit into
Conversation
Shaurya2k06
force-pushed
the
fix/serilog-structured-category-name
branch
from
July 16, 2026 08:08
4e90735 to
acd6f91
Compare
Serilog structured logs captured via EnableLogs now set the canonical category.name attribute from SourceContext when present, matching MEL and the Serilog event path. Signed-off-by: shaurya2k06 <shaurya2k06@gmail.com>
Shaurya2k06
force-pushed
the
fix/serilog-structured-category-name
branch
from
July 16, 2026 08:09
acd6f91 to
7e008f0
Compare
Shaurya2k06
marked this pull request as ready for review
July 16, 2026 08:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Serilog structured logs captured via
EnableLogsnow setcategory.namefrom SerilogSourceContextwhen present. This matches MEL structured logging and Serilog's event path (SentryEvent.Logger).Why
Without
category.name, Serilog structured logs lose the canonical source identifier used for filtering and correlation. The identifier currently appears only asproperty.SourceContext(when present), not as the standard log category attribute.Context
Mirrors the NLog structured logging fix in #5176, which sets
category.namefrom the logger name. The Serilog change was intentionally kept out of that PR to keep it scoped to NLog.Verification
Added Serilog structured logging tests asserting
category.nameis set whenSourceContextis present and absent when it is not.Issues
Closes #5390