Skip to content

docs(dotnet): Update logging docs for SDK 7.0.0 - #19925

Open
jamescrosswell wants to merge 11 commits into
masterfrom
dotnet-v7-logging
Open

jamescrosswell wants to merge 11 commits into
masterfrom
dotnet-v7-logging

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Warning

Do not merge before sentry-dotnet 7.0.0 is released (planned 2026-11-30).

DESCRIBE YOUR PR

Updates the .NET logging docs for sentry-dotnet 7.0.0. In 7.0.0, SentryOptions.EnableLogs and SentryOptions.EnableMetrics are removed, Serilog, NLog and log4net send logs as soon as they're added, and the Serilog, NLog, log4net and Microsoft.Extensions.Logging integrations no longer initialize the SDK. The pages are written for 7.x. The docs aren't versioned, so this stays a draft until 7.0.0 ships.

  • Logs setup, options and usage (platform-includes/logs/*/dotnet.mdx): EnableLogs is only documented on the host options (ASP.NET Core, AWS Lambda, Azure Functions, Blazor Server, Blazor WebAssembly, MAUI). The Serilog, NLog, log4net and Microsoft.Extensions.Logging snippets call SentrySdk.Init and add the integration without a switch. The host and Serilog/NLog/log4net sections explain when EnableLogs sends each log twice.
  • Serilog, NLog and log4net guides: initialize Sentry first, then add the sink/target/appender. Removed initializing through the integration, InitializeSdk, and the DSN, environment, release and <options> settings on the NLog target and log4net appender. Documented Serilog's UseSerilog() and the one-time standard-error warning.
  • NLog includes: removed dsn from the set-tag and set-user variants, including the options.Dsn that feat(docs): Apply new quick start template to .NET quick start guides #19990 added to the set-tag snippet. Deleted the set-environment, set-release and config-intro variants, so the NLog guide uses the generic .NET pages, which set these on the options passed to SentrySdk.Init.
  • Blazor WebAssembly: removed builder.Logging.AddSentry(o => o.InitializeSdk = false), which no longer compiles and was already redundant with UseSentry.
  • Azure Functions: installs Sentry.Extensions.Hosting instead of Sentry.Extensions.Logging, and starts Sentry with .UseSentry(options => ...) on the HostBuilder chain instead of logging.AddSentry(options => ...). EnableLogs = true stays in the snippet, now on SentryGenericHostOptions. Apps with the ASP.NET Core integration (ConfigureFunctionsWebApplication()) call the same UseSentry. The "Changed in Version 7.0.0" alert covers 6.x, which has no hosting package.
  • ASP.NET: removed EnableLogs from the SentrySdk.Init snippet and from the list of features the snippet turns on. Send Logs now says the Serilog, NLog and log4net integrations send logs as soon as they're added, and points to SetBeforeSendLog for dropping them.
  • Metrics options: EnableMetrics was removed in 7.0.0. Kept the advice to return null from SetBeforeSendMetric.

Closes getsentry/sentry-dotnet#5698
Part of getsentry/sentry-dotnet#5706

Notes for review

  • Merged master after feat(docs): Apply new quick start template to .NET quick start guides #19990, which moved the .NET guides to the new quick start template. The Azure Functions and Blazor WebAssembly changes now sit on that template, which already uses UseOtlp() for Azure Functions.
  • The Microsoft.Extensions.Logging snippet on the logs setup page uses SentrySdk.Init plus builder.Logging.AddSentry(), and says in one sentence that generic-host apps use UseSentry from Sentry.Extensions.Hosting instead. The Microsoft.Extensions.Logging guide page is updated in docs(dotnet): Update Microsoft.Extensions.Logging guide for SDK 7.0.0 #19961, so this PR only partly covers delete hidden DS pages #5706.
  • Azure Functions follows feat: add Sentry.Extensions.Hosting with UseSentry for generic host apps sentry-dotnet#5739. It adds Sentry.Extensions.Hosting with UseSentry, and says Azure Functions (isolated) apps use it, also with the ASP.NET Core integration. Checked against version7: SentryGenericHostOptions.EnableLogs defaults to false, and UseSentry registers Sentry's ILogger providers. ConfigureFunctionsWorkerDefaults() and ConfigureFunctionsWebApplication() return IHostBuilder, so the snippet binds to UseSentry(IHostBuilder, Action<SentryGenericHostOptions>). The SDK starts in Build() and closes when the host stops. The version7 sample makes the same call. feat(mel)!: Logging.AddSentry() no longer registers IHub or ISentryClient sentry-dotnet#5740 stops Logging.AddSentry() from registering IHub, so UseSentry is now also what puts it in DI.
  • The logs setup and options includes list dotnet.extensions-hosting in the UseSentry + EnableLogs sections, the appsettings.json tab and the Serilog/NLog/log4net expandables. That's the platform key of the generic-host guide coming in a separate PR, so that PR doesn't need to edit these files. Nothing links to it yet, since the page doesn't exist on this branch. Azure Functions isn't in the Serilog/NLog/log4net expandables: their snippets use builder.Services and builder.Logging, which a HostBuilder chain doesn't have.
  • "Before 7.0.0" notes appear only where a 6.x reader following the page would silently get no logs, or replace their SDK setup: the Serilog/NLog/log4net and Microsoft.Extensions.Logging sections of the logs setup page, the EnableLogs option, and the Azure Functions guide.
  • feat(discover-homepage): Update Discover homepage docs for GA #5698 says an ASP.NET Core app that also uses the Serilog sink sends each log twice with EnableLogs on. That only happens when ILogger entries reach both Sentry's provider and Serilog. I checked against version7: one LogInformation call was sent once with builder.Host.UseSerilog(), which replaces the logger factory, and twice with builder.Logging.AddSerilog(). The same applies to NLog and log4net when they're registered as ILogger providers. So the docs name that case, registering the framework as an ILogger provider (for example builder.Logging.AddSerilog()), and say to leave EnableLogs off then.
  • delete hidden DS pages #5706 describes UseSerilog() as the replacement for ApplySerilogScopeToEvents(). On version7 it's optional: if the app doesn't call it, the sink registers the scope processor itself once it's running, so only events captured before then miss the LogContext properties. The guide says so.
  • Changes beyond the two issues:
    • dotnet.blazor-server added to the EnableLogs sections. It uses Sentry.AspNetCore's UseSentry, but it fell into the plain SentrySdk.Init section, which now says logging integrations need no switch.
    • log4net logs usage no longer mentions SentryAppender.Environment, which 7.0.0 removes (feat(log4net)!: the Sentry appender no longer initializes the SDK sentry-dotnet#5592).
    • The NLog set-user snippet used new User. That type doesn't exist, so it's now SentryUser.
  • The Azure Functions snippet drops TracesSampleRate and DisableSentryHttpMessageHandler, which the version7 sample still sets. Under UseOtlp() Sentry creates no transactions of its own, so TracesSampleRate has no effect. SentryHttpMessageHandler already skips span creation, so disabling it would only stop it propagating sentry-trace. docs(dotnet): Update OTLP propagation docs for SDK 7.0.0 #19924 documents both.
  • The C# and F# snippets I added or changed compile against the version7 sources. The Azure Functions and UseSentry ones compile against the 7.0.0-rc.2 packages, whose public API matches version7.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): 2026-11-30
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

🤖 Generated with Claude Code

In sentry-dotnet 7.0.0, SentryOptions.EnableLogs and EnableMetrics are
removed, and the Serilog, NLog, log4net and Microsoft.Extensions.Logging
integrations no longer initialize the SDK. Initialize Sentry with
SentrySdk.Init or a host integration first, then add the integration.
Serilog, NLog and log4net send logs without a switch; EnableLogs stays
only on the ASP.NET Core, MAUI and Blazor WebAssembly options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Oct 29, 2026 6:54am UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Oct 29, 2026 6:54am UTC

Request Review

UseOpenTelemetry() and TracerProviderBuilder.AddSentry() have been
obsolete since 6.12.0. Use UseOtlp() and AddSentryOtlpExporter from
Sentry.OpenTelemetry.Exporter, as the version7 sample does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread docs/platforms/dotnet/guides/azure-functions-worker/index.mdx Outdated
Comment thread docs/platforms/dotnet/guides/log4net/index.mdx Outdated
Comment thread docs/platforms/dotnet/guides/log4net/index.mdx Outdated
Comment thread docs/platforms/dotnet/guides/nlog/index.mdx Outdated
Comment thread docs/platforms/dotnet/guides/nlog/index.mdx Outdated
Comment thread docs/platforms/dotnet/guides/serilog/index.mdx Outdated
It happens only when Serilog, NLog or log4net is also registered as an
ILogger provider, so name that case instead of "ILogger entries also go
to" the framework.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread platform-includes/metrics/options/dotnet.mdx Outdated
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
@cursor

cursor Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

This change rewrites logging setup pages for a new SDK major. Readers now see Init-first examples. Three logging frameworks send logs without a flag.

The plan checks page loads, client errors, and RSC fetch failures on those paths. An issue escalates when those pages stop loading or those errors rise.

Services: sentry-docs.

Mention @change-monitor in a comment to update the plan.

Plan

What changed

.NET logging pages now tell readers to call SentrySdk.Init first. Serilog, NLog, and log4net send logs as soon as they are added. EnableLogs stays only for ILogger on some hosts. Azure Functions docs no longer initialize the SDK inside AddSentry. Blazor WebAssembly docs drop the extra AddSentry call.

sentry-docs must deploy before this copy is live. The Vercel production project maps to that service. develop-docs does not ship these paths.

Risk

Wrong copy can make readers skip Init or send each log twice. A PlatformSection mistake can show the wrong snippet on sibling logs pages. Removed NLog includes fall back to generic environment and release copy. A failed MDX render can hide Azure Functions or Blazor setup. The shared logs includes also ship to every .NET logs page.

Intended effect

Telemetry cannot show that the new 7.0.0 wording is live. The executor cannot mark intended_effect from metrics. Inspect the live logging pages if a human check is required.

absent would be the live pages still showing EnableLogs on Serilog, NLog, and log4net. That case stays unknown from telemetry.

Regression watch

This diff can break render of the changed guides and every .NET logs page that pulls the shared includes. Watch client errors and RSC fetch failures first. Those are the symptoms users and on-call would see. Then watch not-found and page-load share so a silent blank path is not missed.

Signal Baseline Rule Source
Client errors on /platforms/dotnet pages 8 events in 2026-10-12T04:09:00Z to 2026-10-13T04:09:00Z. Hourly band 0-3. Peak 3 at 2026-10-12T22:00Z. About 1.9 events per 100 page loads, from 8 events against 431 page loads. Titles were TypeError on mw, promise rejection, and an Algolia NetworkError. Hold the hourly band at 0-3. Escalate if the next 24h count rises above 8 while page loads hold. Treat one Algolia or mw event as noise. Sentry org sentry, project docs. Query: environment:production (http.url:*/platforms/dotnet* OR transaction:*/platforms/dotnet*)
RSC fetch failure logs that mention platforms/dotnet 11 matching logs in 2026-10-12T04:09:00Z to 2026-10-13T04:09:00Z. Site-wide RSC fetch failures were 923 in the same window. Hold the .NET slice near 11 per 24h. Escalate if that slice rises while the site-wide count stays near 923. Sentry org sentry, project docs. Query: sentry.environment:production message:"*Failed to fetch RSC payload*" message:"*platforms/dotnet*"
docs.page.not_found for platforms/dotnet 2 counts in 2026-10-12T04:09:00Z to 2026-10-13T04:09:00Z. That is about 0.5 not-found per 100 page loads. Hold 0-2 per 24h. Escalate if the count rises while other platform not-found stays near 19 for platforms/javascript. Sentry org sentry, project docs. Metric docs.page.not_found. Query: sentry.environment:production requested_path:platforms/dotnet
docs.page.load on /platforms/dotnet 431 loads in 2026-10-12T04:09:00Z to 2026-10-13T04:09:00Z. 5485 loads in 2026-10-06T04:09:00Z to 2026-10-13T04:09:00Z. Share of page_type=platforms loads is 431 of 8792, about 4.9%. Changed-path loads in the 24h window: Serilog 3, log4net 4, Blazor WebAssembly 6, NLog 0, Azure Functions worker 0. .NET logs pages totaled 26. Hold the .NET share near 4.9%. Escalate if the logs-page group falls toward 0 while other platform logs pages still load. NLog and Azure Functions worker had 0 loads, so they cannot show a drop on their own. Sentry org sentry, project docs. Metric docs.page.load. Query: environment:production path:*/platforms/dotnet*

Not observable

The new 7.0.0 wording is not in telemetry. Pageload traces did not match these URL transactions, so latency is not a watch. Reader setup mistakes in downstream apps are not in this project.

ric-oliv pushed a commit that referenced this pull request Oct 13, 2026
## DESCRIBE YOUR PR

Fixes two errors in the NLog docs. Both are accurate for the current 6.x
SDK, so this can merge now.

- **NLog guide options list:** `SendEventPropertiesAsData` and
`SendEventPropertiesAsTags` don't exist. The target's settings are
`IncludeEventProperties`, which NLog's `TargetWithContext` provides and
`SentryTarget` sets to `true`, and `IncludeEventPropertiesAsTags`.
`Layout` was described as "layout for the NLog logger". It's the layout
for the message of events sent to Sentry, and defaults to `${message}`.
- **NLog set-tag example:** the C# and F# tabs set `"${logger}"` on the
scope. Sentry doesn't render NLog layouts there, so the tag value was
the literal string `${logger}`. The tabs now add the tag to the target,
matching the `NLog.config` tab, and a sentence says layouts only work in
target tags.

Closes getsentry/sentry-dotnet#5716

### Notes for review

- I checked the options list against
`src/Sentry.NLog/SentryNLogOptions.cs` and `SentryTarget.cs` on
sentry-dotnet `main`. Only target tags go through `RenderLogEvent`.
Nothing in Sentry.NLog reads scope tags. A run against Sentry.NLog
6.12.0 sent `logger = MyApp.Checkout` for the target tag and
`scope_logger = ${logger}` for the scope tag.
- The list is still not exhaustive. It leaves out `BreadcrumbCategory`,
`Dsn`, `Release`, `Environment`, `EnableLogs`, `ShutdownTimeoutSeconds`
and `FlushTimeoutSeconds`. I didn't add them because 7.0.0 removes most
of them from the target.
- The new code tabs set `options.Dsn` to mirror the `dsn` attribute in
the `NLog.config` tab, since the 6.x target initializes the SDK.
- #19925, which merges at sentry-dotnet 7.0.0 GA,
edits the same two files. It removes `InitializeSdk` from the options
list and `dsn` from the set-tag target, so it will need `master` merged
in later. At that point it should also drop `options.Dsn` from the new
code tabs, because `SentryNLogOptions` no longer has it in 7.0.0.
- The C# and F# snippets compile against Sentry.NLog 6.12.0.

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv pushed a commit that referenced this pull request Oct 15, 2026
)

<!-- Keep the urgency section so automation can prioritize this PR. You
may delete other sections you don't need. -->

## DESCRIBE YOUR PR

The Azure Functions (isolated worker) guide sets up tracing with
`TracerProviderBuilder.AddSentry()` and
`SentryOptions.UseOpenTelemetry()` from `Sentry.OpenTelemetry`. Both
have been obsolete since sentry-dotnet 6.12.0, so anyone following the
guide gets obsolete warnings. The guide now uses the OTLP exporter, as
the `Sentry.Samples.OpenTelemetry.AzureFunctions` sample does:

- Install `Sentry.OpenTelemetry.Exporter` instead of
`Sentry.OpenTelemetry`. `OpenTelemetry` is no longer listed because it
comes in transitively. The Package Manager tab now lists the two
OpenTelemetry packages it was missing.
- `AddSentryOtlpExporter(dsn)` and `UseOtlp()` replace `AddSentry()` and
`UseOpenTelemetry()`. The tracing sentence now links to the
OpenTelemetry (OTLP) page.
- The "enabling tracing" link under Features pointed at the generic
tracing concepts page. It now goes to the .NET OpenTelemetry (OTLP) page
too.

Closes getsentry/sentry-dotnet#5715

### Notes for review

- The snippet drops `TracesSampleRate` and
`DisableSentryHttpMessageHandler`, which the sample still sets. Under
`UseOtlp()` Sentry creates no transactions of its own, so
`TracesSampleRate` has no effect, and the OTLP page already says not to
set it. `SentryHttpMessageHandler` already skips span creation under
`UseOtlp()`. Against 6.12.1, an `IHttpClientFactory` request sent with
the handler on still carries a single `sentry-trace` value, and it
matches `traceparent`.
- The snippet's error-monitoring-only variant didn't compile. `using
OpenTelemetry;` and `using Sentry.OpenTelemetry;` sat outside the
performance block, but only the performance option installs those
packages. Neither is needed now: `AddSentryOtlpExporter` lives in
`OpenTelemetry.Trace`, and `UseOtlp` lives in `Sentry`, which the SDK
adds as an implicit using. The snippet now includes `using
Microsoft.Extensions.DependencyInjection;`, which `AddOpenTelemetry()`
needs.
- Both variants of the snippet compile without warnings against Sentry
6.12.1, using the Functions template's `ImplicitUsings`.
- #19925 (merges at 7.0.0 GA) makes the same OTLP
changes on this page, and also moves the options into `SentrySdk.Init`.
When it merges `master` it will conflict in the `logging.AddSentry`
block and on the tracing sentence. That sentence is reworded here into
active voice.

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@ric-oliv

Copy link
Copy Markdown
Member

Looks good to be merged with version7!

@ric-oliv

Copy link
Copy Markdown
Member

Hey James, two things came up after #19990 merged today.

#19990 moved the .NET guides to the new quick start template, which drops the ___PRODUCT_OPTION___ markers and the onboarding checkboxes. It rewrote the Azure Functions and Blazor WebAssembly pages that this PR also changes, so the 7.0 changes for those two pages need to go onto the new template when you rebase.

#19990 also added EnableLogs to the classic ASP.NET guide, and that breaks on 7.0 because SentryOptions no longer has EnableLogs. The page mentions it in three places:

  • line 36, the "Logs from logging integrations" bullet
  • line 61, options.EnableLogs = true; in the SentrySdk.Init snippet
  • line 120, "If you also send logs through an integration, set EnableLogs = true"

Could this PR update that page too? On 7.0, Sentry's logging integrations always send logs once they're added, so the page could say that and point to SetBeforeSendLog for anyone who wants to drop them.

@ric-oliv

ric-oliv commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Hey James, one more thing for this PR. It came up while I looked into getsentry/sentry-dotnet#5755.

The logs setup page already says that EnableLogs sends each entry twice when the app also registers NLog, Serilog or log4net as an ILogger provider. The same thing happens with error events, even with EnableLogs off. UseSentry adds Sentry's own ILogger provider, so a LogError call reaches Sentry through that provider and again through the NLog target or the log4net appender.

I tested it with Sentry.AspNetCore, Sentry.NLog and Sentry.Log4Net 7.0.0-rc.2 and one LogError call without an exception. For NLog I used NLog's builder.Host.UseNLog(). For log4net I used AddLog4Net() from Microsoft.Extensions.Logging.Log4Net.AspNetCore, with MinimumEventLevel set to ERROR on the appender.

Setup NLog events NLog breadcrumbs log4net events log4net breadcrumbs
UseSentry, then ClearProviders() and the framework's provider 1 1 1 0
ClearProviders() and the framework's provider, then UseSentry 2 2 2 1
Same, with Logging:Sentry:MinimumEventLevel and Logging:Sentry:MinimumBreadcrumbLevel set to None 1 1 1 0

The log4net appender turns errors into events without adding a breadcrumb, so there the extra breadcrumb comes only from Sentry's provider. An error logged with an exception arrives once in every case, because duplicate detection drops the second copy. I saw the same duplicate events with NLog's AddNLog(), and on the generic host with Sentry.Extensions.Hosting. This isn't new in v7. Sentry.AspNetCore 6.12.1 sends the same duplicate events for both, with InitializeSdk = false on the NLog target. But I think more people will hit it now, since the target and the appender can't start the SDK anymore and the guides point people to a host integration.

What do you think about a short note in the NLog and log4net guides, right after "Initialize Sentry first, with SentrySdk.Init or a host integration"? Setting both levels to None under Logging:Sentry works wherever UseSentry sits, so I'd suggest that over relying on the ClearProviders() order.

#19990 moved the .NET guides to the new quick start template. Apply
the 7.0 changes to the new Azure Functions and Blazor WebAssembly
pages, and remove EnableLogs from SentrySdk.Init on the classic
ASP.NET page, which #19990 added. Also drop the Dsn that #19990 set on
the NLog target in the set-tag snippet: 7.0 removes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jamescrosswell

Copy link
Copy Markdown
Collaborator Author

Thanks — merged master and moved the Azure Functions and Blazor WebAssembly changes onto the new template. The ASP.NET page now drops EnableLogs from the snippet and the feature list, and says the logging integrations send logs once they're added, with SetBeforeSendLog to drop them. Also removed the options.Dsn that #19990 added to the NLog set-tag snippet, since 7.0 removes it from the target.

@jamescrosswell

Copy link
Copy Markdown
Collaborator Author

@ric-oliv thanks for testing this so thoroughly. Rather than document the workaround, I've opened getsentry/sentry-dotnet#5763 to fix it in the SDK. When the NLog, Serilog or log4net integration already receives an app's ILogger entries, the ILogger providers that UseSentry registers would stand down, so each entry reaches Sentry once whatever order the init calls are in. Your table is in the issue.

Let's hold the duplicate-capture note for the NLog and log4net guides until that's decided. If it lands for 7.0, the note becomes one sentence about which side handles ILogger entries, and the EnableLogs note already in this PR changes the same way. If it doesn't, I'll add your suggestion of setting both Logging:Sentry levels to None.

…y without duplicates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread platform-includes/logs/setup/dotnet.mdx Outdated
Comment thread platform-includes/logs/setup/dotnet.mdx Outdated
… across host apps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jamescrosswell

jamescrosswell commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

Note the External links check will continue to fail until this makes it into main on the sentry-dotnet repo:

That will happen when we make the v7.0.0 release (we don't want to merge these docs until after then anyway).

That PR also addresses the comment from @ric-oliv above.

Comment thread docs/platforms/dotnet/guides/azure-functions-worker/index.mdx Outdated
ric-oliv added a commit that referenced this pull request Oct 28, 2026
getsentry/sentry-dotnet#5755 closed without moving the ILogger
integration out of UseSentry, so EnableLogs stays on the host options.
Logging.AddSentry() can now add Sentry's logger providers back after
ClearProviders(), and DecompressionMethods no longer includes Brotli.

Rewrite the EnableLogs section around what turns logs on in each kind
of app, update the ClearProviders and redundant AddSentry advice, and
add an item for the Brotli default. Sum up the Serilog, NLog and log4net
setups in the guide, so it doesn't depend on #19925 merging first. The
release candidate note lists the two places where rc.2 still differs.

Refs NET-860

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jamescrosswell and others added 2 commits October 29, 2026 19:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sentry-dotnet 7.0.0 adds Sentry.Extensions.Hosting, whose UseSentry
on IHostBuilder is how Azure Functions (isolated) apps start Sentry,
also with the ASP.NET Core integration. Install that package, call
UseSentry on the HostBuilder chain, and set EnableLogs to send ILogger
entries as logs, as on the other host integrations. Remove
SentrySdk.Init and logging.AddSentry() from the snippet.

On the logs setup and options includes, move
dotnet.azure-functions-worker into the UseSentry + EnableLogs sections
and add dotnet.extensions-hosting to them, for the generic-host guide.
The Microsoft.Extensions.Logging section now says that generic-host
apps use UseSentry from Sentry.Extensions.Hosting instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new Generic Host guide (#20311) starts Sentry
with UseSentry, so its logs usage page should show the ILogger section
like the other host integrations, and its requirements start at 7.0.0.
Also say that generic host apps set EnableLogs to send ILogger entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ric-oliv added a commit that referenced this pull request Oct 29, 2026
<!-- Keep the urgency section so automation can prioritize this PR. You
may delete other sections you don't need. -->

## DESCRIBE YOUR PR

This PR adds the migration guide for version 7 of the Sentry SDK for
.NET, ready for the public release candidate, `7.0.0-rc.2`. It follows
the pattern of the Flutter v10 guide from #19390:

- A full guide at `/platforms/dotnet/migration/v6-to-v7/`, built from
one include per change in `includes/migration/dotnet-v7/`.
- An interactive checklist at
`/platforms/dotnet/migration/v6-to-v7/interactive/` that renders the
same includes through `<MigrationGuide migration="dotnet-v7" />`.
- An agent prompt callout that points at the guide's `.md` URL.
- A "Migrating to 7.x" section at the top of the existing .NET migration
page, which links to both.

Both pages live under `common/`, so they render for every .NET guide,
such as ASP.NET Core, MAUI, WPF and Serilog. Xamarin uses a separate
SDK, so the new pages exclude it. I didn't move the 6.x, 4.x and 3.x
sections, so every existing URL and anchor keeps working and the PR
needs no redirects.

To register the collection, the PR adds `dotnet-v7` to the `MIGRATIONS`
map in the `MigrationGuide` component and to the validator's
`COLLECTIONS` map, with specs for both. These changes in
`src/components/migrationGuide/` and `scripts/` touch code that the
JavaScript and Flutter guides share, so they need an approval from the
docs team. For reference, msonnb approved the last change to the
component in #19729, and andreiborza approved the JavaScript interactive
guide that added it in #19076.

The checklist shows one step only on the MAUI guide. Every other step
applies to every .NET guide, because .NET apps combine integrations,
such as a Serilog sink in an ASP.NET Core app.

I checked the guide against `7.0.0-rc.2` from nuget.org and against the
`version7` branch at getsentry/sentry-dotnet@a56c63455. The guide
describes 7.0.0. Where rc.2 still behaves differently, the release
candidate note at the top says so.

### Why this goes live during the release candidate

I'd like to merge this as soon as it's approved, while 7.0 is still in
release candidate. 7.0.0 GA is planned for 2026-11-30. People who try
the release candidate need the guide now, and the agent prompt needs a
published `.md` URL to point at.

Two develop-docs rules pull in different directions here. [Managing
Linear
projects](https://develop.sentry.dev/sdk/getting-started/playbooks/coordination/managing-linear-projects/#visibility-for-major-releases)
says docs "MUST NOT go live before the SDK ships". The [breaking changes
playbook](https://develop.sentry.dev/sdk/getting-started/playbooks/sdk-lifecycle/breaking-changes/#6-update-docs-and-changelog)
says to publish the migration guide "before or alongside the major
release". I read the first rule as protecting users from docs for code
they can't get. Version `7.0.0-rc.2` is public on nuget.org, and the
guide's first block says it's a release candidate and names that
version. Other SDKs made the same call:

- The Python 2.0 guide merged on 2024-02-28, while only the `2.0.0a1`
alpha was out. Its note at the top said so.
- The JavaScript v11 guide merged on 2026-09-08 with `11.0.0-beta.1`
out, and its interactive version followed on 2026-09-11.
- The Flutter v10 guide merged on 2026-10-05 with `10.0.0-rc.2` out,
four days before 10.0.0.

### The release candidate note

The guide opens with one `<Alert>`. It says there is no stable 7.0 yet,
names `7.0.0-rc.2`, and says the rest of the .NET docs describe 6.x
until 7.0.0 ships. It also covers what only the release candidate has:

- `Logging.AddSentry()` after `ClearProviders()` doesn't add Sentry's
logger providers back yet. That came with getsentry/sentry-dotnet#5776,
after rc.2.
- `DecompressionMethods` still includes Brotli, which
getsentry/sentry-dotnet#5816 takes out of the default after rc.2. The
note says how to leave it out until then.
- An ASP.NET Core app that sends `ILogger` entries through NLog crashes
with `Debug` on, tracked in getsentry/sentry-dotnet#5822. The guide's
verify step turns `Debug` on, so the note says to leave it off in those
apps.
- Its `net11.0` builds depend on the .NET 11 release candidate versions
of three `Microsoft.Extensions` packages.

The rest of the guide describes 7.0.0 as released. At GA, I'll delete
that one block from `includes/dotnet-v7-migration-overview.mdx`, and
nothing else needs to change.

### What this PR leaves to other PRs

This PR only adds the guide and what it needs. The reference pages are
in other PRs, and this one doesn't need any of them to merge first:

- Logs and the logging integrations: #19925
- `Microsoft.Extensions.Logging` and ASP.NET Core: #19961
- OpenTelemetry propagation: #19924
- Release and environment: #19960
- Hangfire monitor schedules: #19781

Three links in the guide point to the "Apps That Call UseSentry"
sections that #19925 adds to the Serilog, NLog and log4net guides. Until
#19925 merges, they open those guides at the top, and the migration
guide sums up the same setups itself.

There is no page for the new `Sentry.Extensions.Hosting` package yet.
I'll link it from the guide once that page exists.

Refs https://linear.app/getsentry/issue/NET-860
Refs getsentry/sentry-dotnet#5710

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.

- [x] Urgent deadline (GA date, etc.): 2026-11-30
- [ ] Other deadline: YYYY-MM-DD
- [ ] No deadline: Not urgent, can wait up to 1 week+

## 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](https://github.com/orgs/getsentry/teams/docs)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – sentry-docs — b452bd46 Deployed Oct 29, 2026 by vercel[bot]
Preview – develop-docs — 41d88464 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Urgent Docs review is needed immediately for an urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the logging changes for v7.0.0

3 participants