Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/platforms/dotnet/guides/serilog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ A `LogLevel` which indicates the minimum level a log message has to be sent to S

Whether or not this integration should initialize the SDK. If you intend to call `SentrySdk.Init` yourself you should set this flag to `false`.

#### RestrictedToMinimumLevel

`MinimumBreadcrumbLevel` and `MinimumEventLevel` determine what the sink does with a log event, but every log event the logger captures still reaches the sink. If your logger's minimum level is verbose — for example, because another sink writes debug logs to a file — you can use Serilog's [per-sink minimum level](https://github.com/serilog/serilog/wiki/Configuration-Basics#overriding-per-sink) to stop lower-level log events from reaching Sentry entirely.

By default this value is `Verbose`, meaning no log events are filtered out. Ignored when `LevelSwitch` is set.

<Alert level="warning" title="Note">

This also controls which log entries are sent to Sentry as [structured logs](logs/)

</Alert>
Comment on lines +132 to +136

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.


#### LevelSwitch

An optional `LoggingLevelSwitch` that allows the sink's minimum level to be changed at runtime.

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
Expand Down
Loading