Repository navigation
docs(dotnet): Update logging docs for SDK 7.0.0 - #19925
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
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>
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>
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
|
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: Mention PlanWhat changed.NET logging pages now tell readers to 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. RiskWrong 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 effectTelemetry cannot show that the new 7.0.0 wording is live. The executor cannot mark
Regression watchThis 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.
Not observableThe 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. |
## 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>
As for Serilog: UseSentry starts Sentry when the host is built, so crashes before then aren't sent. Calling SentrySdk.Init before creating the builder, and logging the crash if startup fails, sends them. Refs getsentry/sentry-dotnet#5844 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0408) ## DESCRIBE YOUR PR In 7.0.0 the Serilog sink, NLog target and log4net appender no longer start Sentry. Apps that set the DSN there and also call `UseSentry` used to send crashes from before `UseSentry` started Sentry, and now drop them. This adds "Logging Integrations No Longer Report Startup Crashes" to the 6.x to 7.x migration guide, as a verify step in the interactive checklist. It shows the workaround from getsentry/sentry-dotnet#5847: call `SentrySdk.Init` at the top of `Main` as well, and capture the crash in a `catch`. Without the `catch`, an app with an async `Main` still drops the crash, because `using` disposes the first initialization before the exception reaches the runtime. "Logging Integrations No Longer Initialize Sentry" says to initialize Sentry once, so it now links to the new step. Checked on 7.0.0-rc.3 with a local stand-in for Sentry, crashing after `UseSentry` but before `Run()`: with the `catch`, a sync and an async `Main` each send the crash once. Without it, the async one sends nothing. getsentry/sentry-dotnet#5844 only covers Serilog. On 6.12.1 the NLog target and the log4net appender also sent a crash logged from `Main`, and on 7.0.0-rc.2 an NLog app with only `UseSentry` drops it, so the step covers all three. The links to the "Capturing Startup Crashes" sections of the Serilog, NLog and log4net guides land at the top of each page until #19925 adds them. Refs getsentry/sentry-dotnet#5844 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:_ - [x] Checked Vercel preview for correctness, including links - [x] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [x] 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>
> [!NOTE] > This targets `dotnet-v7`, which collects the .NET docs for sentry-dotnet 7.0.0. #20641 merges that branch into `master` when 7.0.0 ships, so this PR can merge into `dotnet-v7` as soon as it's approved. ## DESCRIBE YOUR PR Adds a Generic Host guide for `Sentry.Extensions.Hosting`, which sentry-dotnet 7.0.0 adds (getsentry/sentry-dotnet#5739). In 7.0.0, `Logging.AddSentry()` no longer initializes the SDK. Worker services, console apps on the generic host, Windows services and Azure Functions (isolated) apps call `UseSentry` from this package instead. The page is written for 7.x. The docs aren't versioned, so this goes live with the rest of the 7.0.0 docs. The guide follows the quick start template from #19990 and covers: - `UseSentry` on `IHostApplicationBuilder` and `IHostBuilder`, the `Sentry` and `Logging:Sentry` sections, and why not to call `Logging.AddSentry()` as well - the host environment, `"Dsn": ""`, and when the SDK starts (`Build()`) and closes (`ApplicationStopped`) - `ClearProviders()` ordering (getsentry/sentry-dotnet#5772, getsentry/sentry-dotnet#5776, getsentry/sentry-dotnet#5789, getsentry/sentry-dotnet#5821) - ASP.NET Core and MAUI apps, and the static `UseSentry` call that Aspire's `AddServiceDefaults` needs - the .NET Framework gap, with the `SentrySdk.Init` and `Logging.AddSentry()` fallback and its `HubAdapter.Instance` registrations (getsentry/sentry-dotnet#5740) - replacing `SentrySdk.Init`, briefly. The migration guide (#20143) covers upgrades. It also adds `platform-includes/configuration/config-intro/dotnet.extensions-hosting.mdx`, so the guide's Options page starts with `UseSentry` instead of `SentrySdk.Init`. Closes getsentry/sentry-dotnet#5707 ### Notes for review - **Registration.** A new .NET guide only needs its `index.mdx`. The platform key `dotnet.extensions-hosting` comes from the folder name, guides without `sidebar_order`, like the other .NET guides, are listed by title, and the icon falls back to the .NET one, as for the Microsoft.Extensions.Logging, Serilog and NLog guides. The page is new, so it needs no redirects. - **Package version.** The install snippets use `packages.version('sentry.dotnet')`, because the release registry has no `sentry.dotnet.extensions.hosting` entry yet. Until 7.0.0 is out, the preview shows 6.12.1, which doesn't exist for this package. Once the registry has the package, switch to its own key. The `sdk:` frontmatter already uses `sentry.dotnet.extensions.hosting` (from `Constants.cs`). Without a registry entry, the page just has no package details box. - **Shared includes that render wrongly for `dotnet.extensions-hosting`.** I left them alone, since other PRs own them: - `platform-includes/logs/setup/dotnet.mdx` falls into the `SentrySdk.Init` section instead of `UseSentry` with `EnableLogs`. #19925 is adding the key to the host sections. - `platform-includes/logs/options/dotnet.mdx` shows the generic `EnableLogs` text and leaves out "Configure Microsoft.Extensions.Logging Filters". Same PR. - `platform-includes/logs/usage/dotnet.mdx` shows only the `SentrySdk.Logger` APIs. The key belongs in the `ILogger` section too. - `platform-includes/logs/requirements/dotnet.mdx` says logs need SDK version 5.14.0. This package starts at 7.0.0. - **Additions to the brief from the `version7` source:** - `"Dsn": ""` turns the SDK off, but `SENTRY_DSN` still wins over an empty `Dsn` (`SettingLocator.GetDsn`). The page says so. - `Logging:Sentry` only accepts `LogLevel`, `MinimumBreadcrumbLevel` and `MinimumEventLevel`. Any other key makes `Build()` throw `NotSupportedException`. With no DSN anywhere, `Build()` throws `ArgumentNullException`. - Calling `Sentry.AspNetCore`'s `UseSentry` twice still sends each error twice (a follow-up in getsentry/sentry-dotnet#5739). The Aspire section says not to call it again in `Program.cs`. - **Azure Functions** gets one line in the intro. The Azure Functions guide still shows `logging.AddSentry(...)`. #19925 owns it. - **Links to add once the other PRs merge:** - Microsoft.Extensions.Logging guide: send generic host apps here, from the "If you use a host integration such as ASP.NET Core or MAUI" paragraph. Its `Sentry.Samples.GenericHost` sample link belongs here too, since the sample now calls `UseSentry`. - Azure Functions guide: link here from the `UseSentry` setup. - `platform-includes/logs/integrations/dotnet.mdx`: add Generic Host to the list. - `docs/product/logs/getting-started/index.mdx` and `docs/product/metrics/getting-started/index.mdx`: add Generic Host to the .NET lists. - Migration guide, "Generic Host Apps Call UseSentry": link to this page. - The sample link points at `main`, where `Sentry.Samples.GenericHost` keeps the 6.x setup until `version7` is merged. - The C# snippets compile against `version7`, on net10.0, and on net48 for the `IHostBuilder` example and the .NET Framework fallback. On net48, `UseSentry` on `HostApplicationBuilder` fails with CS1929, as the page says. ## 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+ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Ricardo Colombo Oliveira <github@ricoliv.com>
…guides - Start the NLog rule at Info in the UseSentry and startup crash snippets. AddSentry() adds a rule for every level, and the target sends every entry it receives as a log, so ASP.NET Core's Trace and Debug entries went to Sentry too. - Set MinimumEventLevel on the log4net appender, which otherwise turns every entry at or above the threshold into an event. - Rethrow after Log.Fatal in the Serilog startup snippet, like the NLog and log4net ones, so the app doesn't exit with code 0 after a crash. - Fix a double space in the NLog advanced example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the deletion of the NLog-specific set-release and set-environment includes. The NLog guide now uses the generic .NET includes, which carry the release and environment text from #19960. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#19961) > [!NOTE] > This targets `dotnet-v7`, which collects the .NET docs for sentry-dotnet 7.0.0. #20641 merges that branch into `master` when 7.0.0 ships, so this PR can merge into `dotnet-v7` as soon as it's approved. ## DESCRIBE YOUR PR In sentry-dotnet 7.0.0 the Microsoft.Extensions.Logging integration no longer initializes the SDK (getsentry/sentry-dotnet#5595). Generic host apps call `UseSentry` from the new `Sentry.Extensions.Hosting` package instead, which has its own guide (#20311). This updates the parts of getsentry/sentry-dotnet#5706 that #19925 leaves out: - **Microsoft.Extensions.Logging guide**: - Generic host apps, ASP.NET Core and MAUI skip this setup and go to their own guides. The note names generic host apps that used `builder.Logging.AddSentry(...)` on 6.x. - Apps without a host call `SentrySdk.Init`, then `AddSentry()`, on a `LoggerFactory` or their own `ServiceCollection`. If they inject `IHub`, `ISentryClient` or `Func<IHub>`, they register them with `HubAdapter.Instance`, because `AddSentry()` no longer does (getsentry/sentry-dotnet#5740). .NET Framework apps on `Host.CreateApplicationBuilder()` are pointed to the Generic Host guide's .NET Framework section. - Structured logs are always sent on this page, and Configure says how to send fewer. - Removes the DSN in `AddSentry(...)`, `InitializeSdk`, and SDK settings under `Logging:Sentry`. Documents what `Logging:Sentry` still accepts, and `AddLogEntryFilter`. - **Generic Host guide**: the `AddLogEntryFilter` link pointed at `#filters`, which this page no longer has. "Replacing SentrySdk.Init" now says `UseSentry` leaves structured logs off until `EnableLogs` is set. - **ASP.NET Core guide**: `SentryAspNetCoreOptions` now extends `SentryHostOptions`, not `SentryLoggingOptions`. Closes getsentry/sentry-dotnet#5706 ### Notes for review - Checked against `origin/version7` (51e7d99fb), which includes getsentry/sentry-dotnet#5869: - Every C# snippet on the Microsoft.Extensions.Logging guide compiles on net10.0 with only `Sentry.Extensions.Logging` referenced. - With `SentrySdk.Init` and `AddSentry()`, every `ILogger` entry is sent as a structured log without `EnableLogs`. - `Logging:Sentry`, added with `AddConfiguration`, is read: `MinimumEventLevel` applies, and a category entry under `LogLevel` drops only that category's structured logs. A `Dsn` key there throws `NotSupportedException` from `LoggerFactory.Create`. - Without the `HubAdapter` lines, a service that injects `IHub` fails with `Unable to resolve service for type 'Sentry.IHub' while attempting to activate ...`. - `ClearProviders()` moved out with the generic host content. It applies to ASP.NET Core's `UseSentry` too, which the ASP.NET Core guide doesn't mention yet. - `Filters` was always internal. The page shows `AddLogEntryFilter`. - The ASP.NET Core paragraph leaves out namespaces. `SentryHostOptions` is still in `Sentry.Extensions.Logging` on `version7`. - On 6.x, `AddSentry()` after `SentrySdk.Init` initializes the SDK again without a DSN, and that throws. That's why the 7.0.0 note tells 6.x users to set the DSN in `AddSentry(...)` instead. - #20240 also edits this page, against 6.x. Whichever merges second needs a merge from `master`. This PR leaves the `Sentry` prefix alert alone, which #20240 rewrites. ## 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+ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Ricardo Colombo Oliveira <github@ricoliv.com>
|
Thanks Ricardo! Applied in 9978fe0:
On the duplicate events you raised on Oct 21: the "Apps That Call UseSentry" sections now cover it. For NLog, |
## DESCRIBE YOUR PR This updates the .NET docs for sentry-dotnet 7.0.0, which has been on NuGet since 2026-11-12. Each change was reviewed in its own PR against the `dotnet-v7` branch, so the 7.x docs go live together: - #20311 docs(dotnet): Add a Generic Host guide for SDK 7.0.0 - #20642 docs(dotnet): Add supported versions to the MAUI guide for SDK 7.0.0 - #19960 docs(dotnet): Document release and environment resolution for SDK 7.0.0 - #19961 docs(dotnet): Update Microsoft.Extensions.Logging guide for SDK 7.0.0 - #19924 docs(dotnet): Update OTLP propagation docs for SDK 7.0.0 - #19925 docs(dotnet): Update logging docs for SDK 7.0.0 - #20715 docs(dotnet): Document ClearProviders() in the ASP.NET Core guide for SDK 7.0.0 - #20752 docs(dotnet): Tell .NET Framework apps to install Microsoft.Extensions.Logging for SDK 7.0.0 - #20743 docs(dotnet): Document NLog's MinimumLogLevel for SDK 7.0.0 - #20742 docs(dotnet): Link the Generic Host guide from the other .NET pages for SDK 7.0.0 - #20689 docs(dotnet): Update the 7.x migration guide for 7.0.0 - #20780 docs(dotnet): Fix Serilog flushing, Serilog usings and the Azure Functions package for SDK 7.0.0 - #20781 docs(dotnet): Fix the .NET logs and metrics examples and other pages for SDK 7.0.0 ### Issues this closes Closes getsentry/sentry-dotnet#5710 The other docs issues for 7.0.0 were closed when their PRs merged into `dotnet-v7`. ### Before merging - [x] sentry-dotnet 7.0.0 is on NuGet. - [x] The release candidate alert is gone from `includes/dotnet-v7-migration-overview.mdx`. - [x] The links that #20311, #19961 and #19925 left for after the other PRs merge are in. - [x] `master` is merged into `dotnet-v7`, and the Vercel preview looks right. - [x] This description has a `Closes` line for every issue that's still open. ## 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-13 - [ ] Other deadline: YYYY-MM-DD - [ ] No deadline: Not urgent, can wait up to 1 week+ --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com> Co-authored-by: ric-oliv <ric-oliv@users.noreply.github.com> Co-authored-by: ric-oliv <5938598+ric-oliv@users.noreply.github.com> Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
Note
This targets
dotnet-v7, which collects the .NET docs for sentry-dotnet 7.0.0. #20641 merges that branch intomasterwhen 7.0.0 ships, so this PR can merge intodotnet-v7as soon as it's approved.DESCRIBE YOUR PR
Updates the .NET logging docs for sentry-dotnet 7.0.0. In 7.0.0,
SentryOptions.EnableLogsandSentryOptions.EnableMetricsare 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 goes live with the rest of the 7.0.0 docs.platform-includes/logs/*/dotnet.mdx):EnableLogsis 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 callSentrySdk.Initand add the integration without a switch. The host and Serilog/NLog/log4net sections explain whenEnableLogssends each log twice.InitializeSdk, and the DSN, environment, release and<options>settings on the NLog target and log4net appender. Documented Serilog'sUseSerilog()and the one-time standard-error warning.dsnfrom the set-tag and set-user variants, including theoptions.Dsnthat 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 toSentrySdk.Init.builder.Logging.AddSentry(o => o.InitializeSdk = false), which no longer compiles and was already redundant withUseSentry.Sentry.Extensions.Hostinginstead ofSentry.Extensions.Logging, and starts Sentry with.UseSentry(options => ...)on theHostBuilderchain instead oflogging.AddSentry(options => ...).EnableLogs = truestays in the snippet, now onSentryGenericHostOptions. Apps with the ASP.NET Core integration (ConfigureFunctionsWebApplication()) call the sameUseSentry. The "Changed in Version 7.0.0" alert covers 6.x, which has no hosting package.EnableLogsfrom theSentrySdk.Initsnippet 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 toSetBeforeSendLogfor dropping them.EnableMetricswas removed in 7.0.0. Kept the advice to returnnullfromSetBeforeSendMetric.Closes getsentry/sentry-dotnet#5698
Part of getsentry/sentry-dotnet#5706
Notes for review
UseSentrystarts Sentry (Document capturing ASP.NET Core startup crashes with Serilog, NLog and log4net in v7.0.0 sentry-dotnet#5844). Each callsSentrySdk.Initbefore the builder; the Serilog one does it alongside Serilog's two-stage initialization. The companion samples, docs(samples): capture startup crashes in the ASP.NET Core Serilog sample sentry-dotnet#5847 and docs(samples): capture startup crashes in the ASP.NET Core NLog sample sentry-dotnet#5866, link to them.masterafter 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 usesUseOtlp()for Azure Functions.SentrySdk.Initplusbuilder.Logging.AddSentry(), and says in one sentence that generic-host apps useUseSentryfromSentry.Extensions.Hostinginstead. 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.Sentry.Extensions.HostingwithUseSentry, and says Azure Functions (isolated) apps use it, also with the ASP.NET Core integration. Checked againstversion7:SentryGenericHostOptions.EnableLogsdefaults tofalse, andUseSentryregisters Sentry'sILoggerproviders.ConfigureFunctionsWorkerDefaults()andConfigureFunctionsWebApplication()returnIHostBuilder, so the snippet binds toUseSentry(IHostBuilder, Action<SentryGenericHostOptions>). The SDK starts inBuild()and closes when the host stops. Theversion7sample makes the same call. feat(mel)!: Logging.AddSentry() no longer registers IHub or ISentryClient sentry-dotnet#5740 stopsLogging.AddSentry()from registeringIHub, soUseSentryis now also what puts it in DI.dotnet.extensions-hostingin theUseSentry+EnableLogssections, theappsettings.jsontab 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 usebuilder.Servicesandbuilder.Logging, which aHostBuilderchain doesn't have.EnableLogsoption, and the Azure Functions guide.EnableLogson. That only happens whenILoggerentries reach both Sentry's provider and Serilog. I checked againstversion7: oneLogInformationcall was sent once withbuilder.Host.UseSerilog(), which replaces the logger factory, and twice withbuilder.Logging.AddSerilog(). The same applies to NLog and log4net when they're registered asILoggerproviders. So the docs name that case, registering the framework as anILoggerprovider (for examplebuilder.Logging.AddSerilog()), and say to leaveEnableLogsoff then.UseSerilog()as the replacement forApplySerilogScopeToEvents(). Onversion7it'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 theLogContextproperties. The guide says so.dotnet.blazor-serveradded to theEnableLogssections. It usesSentry.AspNetCore'sUseSentry, but it fell into the plainSentrySdk.Initsection, which now says logging integrations need no switch.SentryAppender.Environment, which 7.0.0 removes (feat(log4net)!: the Sentry appender no longer initializes the SDK sentry-dotnet#5592).new User. That type doesn't exist, so it's nowSentryUser.TracesSampleRateandDisableSentryHttpMessageHandler, which theversion7sample still sets. UnderUseOtlp()Sentry creates no transactions of its own, soTracesSampleRatehas no effect.SentryHttpMessageHandleralready skips span creation, so disabling it would only stop it propagatingsentry-trace. docs(dotnet): Update OTLP propagation docs for SDK 7.0.0 #19924 documents both.version7sources. The Azure Functions andUseSentryones compile against the 7.0.0-rc.2 packages, whose public API matchesversion7.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-DDwith the due date. You can update this information later by editing the PR description.🤖 Generated with Claude Code