Commit 13dc30d
feat: Logs are always enabled and
* feat: Logs are always enabled and `SentryOptions.EnableLogs` is ignored
Adding one of the logging integrations (`Sentry.Extensions.Logging`,
`Sentry.Serilog`, `Sentry.NLog`, `Sentry.Log4Net`) is already an explicit
opt-in to sending logs, so requiring `EnableLogs = true` on top of that was
just an extra hoop. Structured logs are now captured unconditionally.
`SentryOptions.EnableLogs` and `SentryTarget.EnableLogs` are marked obsolete
rather than removed: the getters always return `true`, the setters are
ignored, and existing configuration (including `"EnableLogs"` in
appsettings.json and `enableLogs` on the Serilog sink) still binds without
error. To drop logs, use `SetBeforeSendLog` and return `null`.
Resolves #5479
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Remove redundant comments
Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
* ref: Create a disabled structured logger for a disabled Hub
Belt-and-braces: `DefaultSentryStructuredLogger` asserts `hub.IsEnabled`, so
`Create` now honours that by construction and returns the disabled logger
otherwise. Restores the disabled-path coverage that the `EnableLogs` test
removed, keyed off the Hub instead of the option.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test: Update Versioning snapshots for net8.0/net9.0
`WebIntegrationTests.Versioning` has per-TFM snapshots; only the net10.0 one
was regenerated locally (no net8/net9 runtimes on the dev machine). Taken
byte-for-byte from the CI artifacts, which produced an identical delta on
every platform.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test: Assert only on transactions in PreFlightIgnoresTransaction
Review feedback: the hub isn't disabled, so logs are captured as usual —
excluding logs was the wrong way round. Assert directly that no transaction
envelope item is sent, which is the only thing the test needs to show.
Uses the existing EnvelopeItem.TryGetType() and TypeValueTransaction rather
than a hand-rolled header lookup.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Revert "ref: Create a disabled structured logger for a disabled Hub"
This reverts commit 12ec118.
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>SentryOptions.EnableLogs is ignored (#5504)1 parent a4e3ca3 commit 13dc30d
68 files changed
Lines changed: 412 additions & 218 deletions
File tree
- benchmarks/Sentry.Extensions.Logging.Benchmarks
- samples
- Sentry.Samples.AspNetCore.Basic
- Sentry.Samples.AspNetCore.Grpc
- Sentry.Samples.AspNetCore.Mvc
- Sentry.Samples.GenericHost
- Sentry.Samples.Google.Cloud.Functions
- Sentry.Samples.ME.AI.AspNetCore
- Sentry.Samples.ME.Logging
- Sentry.Samples.Maui
- Sentry.Samples.NLog
- Sentry.Samples.Serilog
- src
- Sentry.Extensions.Logging
- Sentry.Log4Net
- Sentry.NLog
- Sentry.Serilog
- Sentry
- test
- Sentry.AspNetCore.Tests
- Sentry.Extensions.Logging.Tests
- Sentry.Google.Cloud.Functions.Tests
- Sentry.Log4Net.Tests
- Sentry.Maui.Tests
- Internal
- Sentry.NLog.Tests
- Sentry.Serilog.Tests
- Sentry.Tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
| 81 | + | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
0 commit comments