Skip to content

How to use with sinks that depend on ConfigureServices being run first? #84

Closed
serilog/serilog-extensions-hosting
#20
@cmeeren

Description

@cmeeren

I'm using this with Serilog.Sinks.ApplicationInsights, but AFAIK there seems to be a conflict:

  • When calling .UseSerilog with the configureLogger parameter, configureLogger (which among other things calls Serilog.Sinks.ApplicationInsights' WriteTo.ApplicationInsights) is executed before ASP.NET Core's ConfigureServices.
  • ConfigureServices sets up TelemetryConfiguration.Active
  • WriteTo.ApplicationInsights needs TelemetryConfiguration.Active to be set up correctly

Is there a way to solve this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions