Skip to content

DiagnosticContext doesn't use the logger created by LoggerConfiguration #52

@cbersch

Description

@cbersch

When using the

public static IHostBuilder UseSerilog(
    this IHostBuilder builder,
    Action<HostBuilderContext, IServiceProvider, LoggerConfiguration> configureLogger,
    bool preserveStaticLogger = false,
    bool writeToProviders = false)

extension and calling it with preserveStaticLogger: true, the ILogger, which is created by LoggerConfiguration, is not used by DiagnosticContext.
I would expect, the logger instance itself to be always passed to DiagnosticContext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions