Repository navigation
Events from the logging integrations no longer list the integration's package in sdk.packages #5649
Description
Description
On version7, events that the Serilog sink captures no longer list nuget:Sentry.Serilog in sdk.packages. The NLog, log4net and Microsoft.Extensions.Logging pull requests for #5245 drop their packages the same way.
We decided in #5497 that sdk.name should identify the integration that initialized the SDK, so the logging integrations stopped setting the name. The same commits also removed their AddPackage calls. sdk.packages is a list, so an integration can add its package without changing the name. Structured logs record the logging integration in their origin, for example auto.log.serilog, but events have no origin. After this change, nothing on an event records which logging integration captured it.
None of this has shipped. #5573 is merged into version7, and #5585, #5592 and #5595 are still open.
Reproduction
Run samples/Sentry.Samples.AspNetCore.Serilog, log an error through Serilog during a request, and compare the sdk block of the event on each branch.
On main, the event lists three packages:
"sdk": {
"name": "sentry.dotnet.aspnetcore",
"version": "6.11.1-dev",
"packages": [
{
"name": "nuget:Sentry.Serilog",
"version": "6.11.1-dev"
},
{
"name": "nuget:Sentry.AspNetCore",
"version": "6.11.1-dev"
},
{
"name": "nuget:sentry.dotnet",
"version": "6.11.1-dev"
}
]
}On version7, nuget:Sentry.Serilog is missing:
"sdk": {
"name": "sentry.dotnet.aspnetcore",
"version": "7.0.0-prerelease",
"packages": [
{
"name": "nuget:Sentry.AspNetCore",
"version": "7.0.0-prerelease"
},
{
"name": "nuget:sentry.dotnet",
"version": "7.0.0-prerelease"
}
]
}The name matches on both branches because the ASP.NET Core request scope overwrites it. An event from the NLog target on the #5585 branch has the same gap. Its packages list only contains nuget:sentry.dotnet.
No test catches this. test/Sentry.Testing/VerifyExtensions.cs calls IgnoreMembersWithType<SdkVersion>(), so the snapshot tests skip the sdk block of events.
Proposed fix
Restore the package on the events each logging integration creates, and leave sdk.name as it is. This table shows where 6.x added the package.
| Integration | 6.x | Removed in |
|---|---|---|
| Serilog | SentrySink added it to each event |
#5573 |
| NLog | SentryTarget added it to each event |
#5585 |
| log4net | SentryAppender added it to each event |
#5592 |
| Microsoft.Extensions.Logging | SentryLoggerProvider added it to a scope that it pushed |
#5595 |
For Microsoft.Extensions.Logging, adding the package to the events that SentryLogger creates would match the other three. Each integration should get a test that captures an event and checks sdk.packages.
This needs to land on version7 before 7.0.0 ships. It can follow #5595, so that one change covers all four integrations.
Activity
linear-code commentedon Sep 30, 2026
NET-835
jamescrosswell commentedon Oct 1, 2026
We intentionally changed the
sdk.nameto matche whatever integration initialises the SDK... so a console app (even if it adds the serilog integration) will now have the sdk namesentry.dotnetand an Asp.Net Core app (even it if tadds the serilog integration) will now have the sdk namesentry.dotnet.aspnetcore.The logger used to send logs is indicated via the
originproperty instead.So as long as that's what we mean by "leave
sdk.nameas it is" that's OK.. We don't want to revert to the behaviour from 6.x.jamescrosswell commentedon Oct 1, 2026
btw I don't think we've been reilably setting the Milestone to 7.0.0 in Github... I added this to the 7.0 project in Linear (which is the source of truth for what's included in the 7.0 release).
fix: list the logging integration's package in sdk.packages of the ev…
ric-oliv commentedon Oct 9, 2026
Merged to version7