Skip to content

Sentry.Serilog throws if a DSN is not passed even though SentrySdk should already be initialized #2866

Closed
@kanadaj

Description

Package

Sentry

.NET Flavor

.NET

.NET Version

8.0.0

OS

Any (not platform specific)

SDK Version

4.0.0-beta.1

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Add Sentry.Serilog and Sentry.AspNetCore to the app
  2. Init Sentry with `builder.ConfigureWebHostDefaults(webBuilder => webBuilder.UseSentry(...));```
  3. Try adding serilog with builder.Services.CongureLogging()
  4. Use .WriteTo.Sentry() with no arguments

Expected Result

The Serilog .WriteTo.Sentry() call shouldn't throw if SentrySdk is already initialized in the HostBuilder with .UseSentry()

Actual Result

Throws during startup with ArgumentNullException

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

BugSomething isn't working

Type

No type

Projects

  • Status

    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions