Skip to content

Document the logging changes for v7.0.0 #5698

Closed
getsentry/sentry-docs
#19925

Description

@ric-oliv

Follow-up to #5183. #5642 and #5676 changed how .NET apps turn on logs in 7.0.0, and the docs still describe 6.x. #5642 said the docs would come in a separate sentry-docs PR, and nobody has opened it yet.

The .NET docs aren't versioned. As with #5546, the new text should say that it applies from 7.0.0 on, or the PR should merge when 7.0.0 ships.

What changed in 7.0.0

Pages to update in getsentry/sentry-docs

  • platform-includes/logs/setup/dotnet.mdx sets EnableLogs in the SentrySdk.Init, Logging.AddSentry(), Serilog, NLog and log4net snippets. Remove it from those snippets and their notes, including the appsettings.json example for Microsoft.Extensions.Logging. Keep it for ASP.NET Core, AWS Lambda, Blazor WebAssembly and MAUI.
  • platform-includes/logs/options/dotnet.mdx should describe EnableLogs as a setting of the host integrations only.
  • The Serilog, NLog and log4net guide pages say that log messages go to Sentry "when enabled". Say instead that adding the integration is enough.
  • docs/platforms/dotnet/guides/blazor-webassembly/index.mdx: the setup snippet calls builder.Logging.AddSentry(o => o.InitializeSdk = false) after UseSentry. In 7.0.0 that line doesn't compile, because InitializeSdk is obsolete as an error since feat(mel)!: the Microsoft.Extensions.Logging integration no longer initializes the SDK, and it adds nothing since fix!: apps that call both UseSentry and Logging.AddSentry() no longer capture each error, breadcrumb and log twice. Remove it. The Blazor WebAssembly sample already calls only UseSentry.
  • docs/platforms/dotnet/guides/azure-functions-worker/index.mdx: the snippet initializes the SDK through logging.AddSentry(options => { options.Dsn = ...; ... }). The logging integration no longer initializes the SDK in 7.0.0 (getsentry/sentry-dotnet#5245), so those options move to a SentrySdk.Init call and logging.AddSentry() takes none. The Sentry.Samples.OpenTelemetry.AzureFunctions sample on version7 already does this.
  • docs/platforms/dotnet/common/migration/index.mdx has no 7.x section yet. Its breaking changes should list the removal of SentryOptions.EnableLogs and of Serilog's enableLogs parameter.
  • platform-includes/metrics/options/dotnet.mdx says EnableMetrics "is obsolete and ignored since version 6.10.0, and will be removed in version 7.0.0". feat!: remove SentryOptions.EnableMetrics #5690 removed it, so from 7.0.0 the entry should say it was removed, and keep the advice to return null from SetBeforeSendMetric to drop metrics.

Also cover

  • An ASP.NET Core app that also uses the Serilog sink sends each log twice when EnableLogs is on, once from each provider.
  • The Serilog and NLog snippets on the setup page also pass a DSN to the integration. Don't initialise the Sdk from logging integrations #5245 stopped the logging integrations from initializing the SDK in 7.0.0, so those snippets need a SentrySdk.Init call in any case.

Activity

  1. added
    .NET
    Next Major
    on Oct 8, 2026
  2. linear-code commented on Oct 8, 2026

    @linear-code
  3. changed the title [-]Document the logs opt-in changes for v7.0.0[/-] [+]Document the logging changes for v7.0.0[/+] on Oct 9, 2026
  4. added a commit that references this issue on Nov 11, 2026
    7deb11e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETDocsLogsNext Major

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions