docs(dotnet): Document Serilog per-sink minimum level options#18740
Merged
dingsdax merged 3 commits intoJul 20, 2026
Conversation
Sentry.Serilog 6.8.0 adds RestrictedToMinimumLevel and LevelSwitch options so Serilog's per-sink minimum level can be configured in code. Previously this was only possible via appsettings.json, which was painful for MAUI users who configure Serilog in code. Add a section explaining how the per-sink level differs from MinimumBreadcrumbLevel/MinimumEventLevel, with code and appsettings examples, and document the two new options. Refs getsentry/sentry-dotnet#4957 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jamescrosswell
commented
Jul 17, 2026
jamescrosswell
commented
Jul 17, 2026
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
jamescrosswell
marked this pull request as ready for review
July 17, 2026 03:22
dingsdax
approved these changes
Jul 20, 2026
dingsdax
approved these changes
Jul 20, 2026
Comment on lines
+132
to
+136
| <Alert level="warning" title="Note"> | ||
|
|
||
| This also controls which log entries are sent to Sentry as [structured logs](logs/) | ||
|
|
||
| </Alert> |
Contributor
There was a problem hiding this comment.
Bug: The documentation incorrectly claims RestrictedToMinimumLevel filters structured logs. This setting likely only affects breadcrumbs and events, not structured logs sent to Sentry.
Severity: MEDIUM
Suggested Fix
Verify the actual behavior of RestrictedToMinimumLevel in the sentry-dotnet SDK. If it does not filter structured logs, remove the statement "This also controls which log entries are sent to Sentry as structured logs" from the documentation. The filtering of structured logs should be attributed to the global MinimumLogLevel.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: docs/platforms/dotnet/guides/serilog/index.mdx#L132-L136
Potential issue: The documentation update claims that the Serilog sink's
`RestrictedToMinimumLevel` setting controls which log entries are sent to Sentry as
structured logs. This is likely incorrect. Based on the pattern in the
`Extensions.Logging` integration and existing Serilog documentation, per-sink level
filters typically only apply to breadcrumbs and events. The global `MinimumLogLevel` is
what likely controls structured log capturing. Users following this new documentation
may mistakenly believe they are filtering structured logs, leading to more data being
sent to Sentry than intended.
Did we get this right? 👍 / 👎 to inform future reviews.
dingsdax
deleted the
jamescrosswell/docs/serilog-restricted-to-minimum-level
branch
July 20, 2026 15:47
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.
DESCRIBE YOUR PR
Documents the new Serilog per-sink minimum level configuration added in getsentry/sentry-dotnet#5181 (fixes getsentry/sentry-dotnet#4957), shipping in Sentry.Serilog 6.8.0.
MinimumBreadcrumbLevel/MinimumEventLevel, with code andappsettings.jsonexamplesRestrictedToMinimumLevelandLevelSwitchoptionsappsettings.json)Note: the C# snippets were compiled against
sentry-dotnet@mainto confirm they build. The version number in the alert assumes the next release is 6.8.0 — please double-check once it's tagged.IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
🤖 Generated with Claude Code