Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
36fde27
feat: Serilog sink no longer initializes the SDK
jamescrosswell Sep 14, 2026
5385388
Accept API verifier changes
getsentry-bot Sep 14, 2026
f7f48a5
Merge remote-tracking branch 'origin/version7' into feat/no-init-from…
jamescrosswell Sep 14, 2026
9f8ec8c
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 14, 2026
c72c26e
Tweak comments in the samples
jamescrosswell Sep 17, 2026
cafeb7b
feat: NLog target no longer initializes the SDK
jamescrosswell Sep 17, 2026
19db652
Tweaked wording
jamescrosswell Sep 17, 2026
489d7ce
feat: NLog target flushes using the SDK's FlushTimeout
jamescrosswell Sep 17, 2026
6438db5
feat: log4net appender no longer initializes the SDK
jamescrosswell Sep 17, 2026
d2e7281
feat: Microsoft.Extensions.Logging integration no longer initializes …
jamescrosswell Sep 17, 2026
d318a86
feat: SentryHostOptions replaces SentryLoggingOptions as the base for…
jamescrosswell Sep 18, 2026
0aada87
docs: drop unused Sentry settings from the Serilog sample appsettings
jamescrosswell Sep 21, 2026
5acfa5e
fix(serilog): make the UseSerilog warning check atomic
jamescrosswell Sep 21, 2026
5686eba
refactor: the logging integration no longer stamps the SDK name or di…
jamescrosswell Sep 22, 2026
d038075
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 22, 2026
3307c30
refactor: the Serilog sink no longer sets the SDK name
jamescrosswell Sep 22, 2026
bbc1166
Merge branch 'feat/no-init-from-logging-5245' into feat/no-init-from-…
jamescrosswell Sep 22, 2026
62dad84
refactor: the NLog target no longer sets the SDK name
jamescrosswell Sep 22, 2026
b9b9dda
Merge branch 'feat/no-init-from-logging-nlog-5245' into feat/no-init-…
jamescrosswell Sep 22, 2026
5e04b92
refactor: the log4net appender no longer sets the SDK name
jamescrosswell Sep 22, 2026
341d3a0
Merge branch 'feat/no-init-from-logging-log4net-5245' into feat/no-in…
jamescrosswell Sep 22, 2026
f6c72ae
refactor: structured logs from Microsoft.Extensions.Logging no longer…
jamescrosswell Sep 22, 2026
72d27f9
feat(serilog): configuring a DSN on the sink now fails with a migrati…
ric-oliv Sep 22, 2026
9d27112
test(serilog): pin the DSN tombstone against Serilog.Settings.Configu…
jamescrosswell Sep 22, 2026
f6039d3
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 22, 2026
ab2bb85
feat(nlog): configuring a DSN on the target now fails with a migratio…
jamescrosswell Sep 22, 2026
ed73567
docs(serilog): reword the DSN migration error
jamescrosswell Sep 22, 2026
6517170
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 22, 2026
5ab9e8f
docs(nlog): reword the DSN migration error to match Serilog
jamescrosswell Sep 22, 2026
95cbdae
Merge remote-tracking branch 'origin/feat/no-init-from-logging-nlog-5…
jamescrosswell Sep 22, 2026
ca044b4
feat(log4net): configuring a DSN on the appender now reports a migrat…
jamescrosswell Sep 22, 2026
d15c91e
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 22, 2026
2e9b9c7
feat(mel): configuring a DSN through the logging integration now fail…
jamescrosswell Sep 22, 2026
6649270
fix(mel): only treat a supplied Dsn or InitializeSdk as a migration e…
jamescrosswell Sep 23, 2026
a1bf334
fix(serilog): the Sentry sink registers the Serilog scope event proce…
ric-oliv Sep 23, 2026
6c8c4d9
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 23, 2026
7b88c80
fix(serilog): register the scope event processor atomically
jamescrosswell Sep 23, 2026
f76ac32
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 23, 2026
53f4144
refactor(serilog): use the Lock shim for the registration lock
jamescrosswell Sep 23, 2026
0925c1d
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 23, 2026
63d5b84
Merge remote-tracking branch 'origin/feat/no-init-from-logging-nlog-5…
jamescrosswell Sep 23, 2026
63cafc5
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 23, 2026
14e59b1
Tidy comments
jamescrosswell Sep 23, 2026
bbf2ffd
Merge remote-tracking branch 'origin/version7' into feat/no-init-from…
jamescrosswell Sep 23, 2026
a8a1ea9
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 23, 2026
c6327ce
Merge remote-tracking branch 'origin/feat/no-init-from-logging-nlog-5…
jamescrosswell Sep 23, 2026
aa11db1
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 23, 2026
ba78b29
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 23, 2026
a082174
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 23, 2026
fbbaa39
docs: samples are exempt from the no-comments rule
jamescrosswell Sep 23, 2026
5f4f1d1
Apply suggestion from @jamescrosswell
jamescrosswell Sep 23, 2026
2925072
feat(serilog): warn at runtime when the sink drops events because Sen…
jamescrosswell Sep 28, 2026
5ff4ec6
Merge remote-tracking branch 'origin/feat/no-init-from-logging-5245' …
jamescrosswell Sep 28, 2026
0a57f71
feat(nlog): warn at runtime when the target drops events because Sent…
jamescrosswell Sep 28, 2026
abfbe29
Merge remote-tracking branch 'origin/feat/no-init-from-logging-nlog-5…
jamescrosswell Sep 28, 2026
3f30836
feat(log4net): warn at runtime when the appender drops events because…
jamescrosswell Sep 28, 2026
e133cea
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 28, 2026
7e17339
feat(mel): warn at runtime when the integration drops events because …
jamescrosswell Sep 28, 2026
c5fbba6
docs(mel): match the other integrations' migration-error phrasing
jamescrosswell Sep 29, 2026
7d92ca3
Merge remote-tracking branch 'origin/version7' into feat/no-init-from…
jamescrosswell Sep 29, 2026
9999e9a
Merge remote-tracking branch 'origin/feat/no-init-from-logging-nlog-5…
jamescrosswell Sep 29, 2026
dfcb80c
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 29, 2026
9d467f1
fix: UseSentry now initializes Sentry even when Logging.AddSentry ran…
jamescrosswell Sep 29, 2026
248c671
test(log4net): Run the configuration binding tests against log4net 3 …
ric-oliv Sep 30, 2026
ae9cdda
fix(nlog): report a stale dsn and accept initializeSdk=false (#5652)
ric-oliv Sep 30, 2026
230348b
Merge remote-tracking branch 'origin/feat/no-init-from-logging-nlog-5…
jamescrosswell Sep 30, 2026
af47132
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 30, 2026
f79645c
Merge remote-tracking branch 'origin/feat/no-init-from-logging-log4ne…
jamescrosswell Sep 30, 2026
b3d2e57
test: keep the real environment out of the disabled-SDK tests
jamescrosswell Sep 30, 2026
04a5a54
feat: read core SDK settings only from the Sentry configuration section
jamescrosswell Oct 1, 2026
ae42363
fix(blazor): bind configuration before the UseSentry callback
jamescrosswell Oct 1, 2026
d3a2159
Format code
getsentry-bot Oct 1, 2026
d8038ca
fix(maui)!: options set in UseSentry now take precedence over appsett…
jamescrosswell Oct 1, 2026
7f63d95
Merge remote-tracking branch 'origin/version7' into fix/maui-config-p…
jamescrosswell Oct 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/Sentry.Maui/Internal/SentryMauiConfigurationOptionsSetup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;

namespace Sentry.Maui.Internal;

internal class SentryMauiConfigurationOptionsSetup : IConfigureOptions<SentryMauiOptions>
{
private readonly IConfiguration _config;

public SentryMauiConfigurationOptionsSetup(IConfiguration config)
{
ArgumentNullException.ThrowIfNull(config);
_config = config.GetSection("Sentry");
}

public void Configure(SentryMauiOptions options)
{
ArgumentNullException.ThrowIfNull(options);

var bindable = new BindableSentryMauiOptions();
_config.Bind(bindable);
bindable.ApplyTo(options);
}
}
13 changes: 0 additions & 13 deletions src/Sentry.Maui/Internal/SentryMauiOptionsSetup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
#if !PLATFORM_NEUTRAL
using Microsoft.Maui.Networking;
Expand All @@ -10,22 +9,10 @@ namespace Sentry.Maui.Internal;

internal class SentryMauiOptionsSetup : IConfigureOptions<SentryMauiOptions>
{
private readonly IConfiguration _config;

public SentryMauiOptionsSetup(IConfiguration config)
{
ArgumentNullException.ThrowIfNull(config);
_config = config.GetSection("Sentry");
}

public void Configure(SentryMauiOptions options)
{
ArgumentNullException.ThrowIfNull(options);

var bindable = new BindableSentryMauiOptions();
_config.Bind(bindable);
bindable.ApplyTo(options);

#if __ANDROID__ || __IOS__
options.Native.AttachScreenshot = options.AttachScreenshot;
#endif
Expand Down
1 change: 1 addition & 0 deletions src/Sentry.Maui/SentryMauiAppBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static MauiAppBuilder UseSentry(this MauiAppBuilder builder,
{
var services = builder.Services;

services.AddSingleton<IConfigureOptions<SentryMauiOptions>, SentryMauiConfigurationOptionsSetup>();
if (configureOptions != null)
{
services.Configure(configureOptions);
Expand Down
61 changes: 61 additions & 0 deletions test/Sentry.Maui.Tests/SentryMauiAppBuilderExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Sentry.Internal.Http;
Expand Down Expand Up @@ -143,6 +144,46 @@ public void CanUseSentry_WithConfigurationAndOptions()
Assert.Equal("test", options.Release);
}

[Fact]
public void UseSentry_SetInConfigurationAndCallback_CallbackWins()
{
// Arrange
var builder = _fixture.Builder;
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string>
{
["Sentry:Release"] = "from-configuration"
});

// Act
builder.UseSentry(options => options.Release = "from-code");

using var app = builder.Build();
var options = app.Services.GetRequiredService<IOptions<SentryMauiOptions>>().Value;

// Assert
options.Release.Should().Be("from-code");
}

[Fact]
public void UseSentry_SetInConfigurationOnly_ConfigurationApplies()
{
// Arrange
var builder = _fixture.Builder;
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string>
{
["Sentry:Environment"] = "from-configuration"
});

// Act
builder.UseSentry(options => options.Release = "from-code");

using var app = builder.Build();
var options = app.Services.GetRequiredService<IOptions<SentryMauiOptions>>().Value;

// Assert
options.Environment.Should().Be("from-configuration");
}

[Fact]
public void UseSentry_EnablesGlobalMode()
{
Expand Down Expand Up @@ -336,6 +377,26 @@ public void UseSentry_DebugTrue_ConsoleAndTracingDiagnosticsLogger()
options.DiagnosticLogger.Should().BeOfType<ConsoleAndTraceDiagnosticLogger>();
}

[Fact]
public void UseSentry_DebugTrueInConfiguration_ConsoleAndTracingDiagnosticsLogger()
{
// Arrange
var builder = _fixture.Builder;
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string>
{
["Sentry:Debug"] = "true"
});

// Act
builder.UseSentry(ValidDsn);

using var app = builder.Build();
var options = app.Services.GetRequiredService<IOptions<SentryMauiOptions>>().Value;

// Assert
options.DiagnosticLogger.Should().BeOfType<ConsoleAndTraceDiagnosticLogger>();
}

[Fact]
public void UseSentry_DebugTrue_CustomDiagnosticsLogger()
{
Expand Down