Skip to content

Enhance logging documentation for Microsoft.Extensions.Logging#17506

Open
KyleTryon wants to merge 12 commits intomasterfrom
docs/logs_dotnet_integration_defaults
Open

Enhance logging documentation for Microsoft.Extensions.Logging#17506
KyleTryon wants to merge 12 commits intomasterfrom
docs/logs_dotnet_integration_defaults

Conversation

@KyleTryon
Copy link
Copy Markdown
Contributor

This pull request updates the .NET logging documentation to clarify how to enable and configure logging integration with Sentry, especially for applications using Microsoft.Extensions.Logging. The changes provide clearer guidance on how logs are filtered, how the EnableLogs option interacts with different logging APIs, and how Sentry respects existing logging configurations.

Improvements to logging setup and configuration:

  • Clarified that setting EnableLogs = true enables both the SentrySdk.Logger APIs and supported platform logging integrations (e.g., Microsoft.Extensions.Logging, Serilog), but does not capture Console.WriteLine() output.
  • Added a new section explaining how to configure Microsoft.Extensions.Logging filters to control which logs are sent to Sentry, including code samples for appsettings.json and in-code filter configuration.

Clarifications on logging behavior:

  • Explained that Sentry respects existing Microsoft.Extensions.Logging category and provider configurations, ensuring log filtering and disabling can be managed using standard .NET logging configuration. [1] [2]
  • Clarified the use of SetBeforeSendLog for filtering or updating logs before they are sent to Sentry.

…Logging integration

- Added detailed instructions for configuring logging filters with Microsoft.Extensions.Logging.
- Clarified the behavior of `EnableLogs` and its interaction with Sentry's logging capabilities.
- Included code examples for both JSON configuration and programmatic filter setup.
- Updated initialization instructions to specify that `EnableLogs` must be set to true for logging to function correctly.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Apr 29, 2026 9:21pm
sentry-docs Ready Ready Preview, Comment Apr 29, 2026 9:21pm

Request Review

Comment thread platform-includes/logs/usage/dotnet.mdx Outdated
Comment thread platform-includes/logs/usage/dotnet.mdx Outdated
Comment thread platform-includes/logs/setup/dotnet.mdx Outdated
Comment thread platform-includes/logs/setup/dotnet.mdx
Comment thread platform-includes/logs/setup/dotnet.mdx
Comment thread platform-includes/logs/setup/dotnet.mdx
Comment thread platform-includes/logs/options/dotnet.mdx Outdated
Comment thread platform-includes/logs/options/dotnet.mdx
Comment thread platform-includes/logs/options/dotnet.mdx Outdated
Comment thread platform-includes/logs/options/dotnet.mdx Outdated
KyleTryon and others added 9 commits April 29, 2026 16:41
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Co-authored-by: Stefan Pölz <38893694+Flash0ver@users.noreply.github.com>
Comment thread platform-includes/logs/options/dotnet.mdx Outdated
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.

2 participants