Skip to content

UseSerilogRequestLogging and additional providers #258

@EDKAMO

Description

@EDKAMO

We used to do this:

 // Configure logging providers
 builder.Logging.ClearProviders();
 builder.Logging.AddSerilog();
 builder.Logging.AddCustomLoggerProvider();

However, to use UseSerilogRequestLogging you have to do services.AddSerilog()

I can't manage to get the custom logger provider to work. We tried using AddSerilog(this IServiceCollection collection, ILogger logger = null, bool dispose = false, LoggerProviderCollection providers = null) but it doesn't seem to work.

per https://github.com/serilog/serilog-aspnetcore/blob/680af2e3c6b16740366d6dc4a96d20cfa9ceab01/README.md?plain=1#L51

The builder.Services.AddSerilog() call will redirect all log events through your Serilog pipeline.

How can we add custom logger providers to the Serilog pipeline?

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