Skip to content

docs(dotnet): Document Serilog per-sink minimum level options#18740

Merged
dingsdax merged 3 commits into
masterfrom
jamescrosswell/docs/serilog-restricted-to-minimum-level
Jul 20, 2026
Merged

docs(dotnet): Document Serilog per-sink minimum level options#18740
dingsdax merged 3 commits into
masterfrom
jamescrosswell/docs/serilog-restricted-to-minimum-level

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

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.

  • Adds a "Filtering Which Log Events Reach Sentry" section to the Serilog guide explaining how the per-sink minimum level differs from MinimumBreadcrumbLevel/MinimumEventLevel, with code and appsettings.json examples
  • Documents the new RestrictedToMinimumLevel and LevelSwitch options
  • Notes that configuring this in code requires Sentry.Serilog 6.8.0+ (previously only possible via appsettings.json)

Note: the C# snippets were compiled against sentry-dotnet@main to 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.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview Jul 20, 2026 3:40pm
sentry-docs Ready Ready Preview Jul 20, 2026 3:40pm

Request Review

Comment thread docs/platforms/dotnet/guides/serilog/index.mdx Outdated
Comment thread docs/platforms/dotnet/guides/serilog/index.mdx Outdated
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
@codeowner-assignment
codeowner-assignment Bot requested a review from a team July 20, 2026 15:32
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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
dingsdax merged commit 68dbf0d into master Jul 20, 2026
23 checks passed
@dingsdax
dingsdax deleted the jamescrosswell/docs/serilog-restricted-to-minimum-level branch July 20, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support restrictedToMinimumLevel when configuring Serilog in code

2 participants