Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseSerilogRequestLogging and additional providers #258

Open
EDKAMO opened this issue Sep 10, 2024 · 1 comment
Open

UseSerilogRequestLogging and additional providers #258

EDKAMO opened this issue Sep 10, 2024 · 1 comment

Comments

@EDKAMO
Copy link

EDKAMO commented Sep 10, 2024

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?

@bartelink
Copy link
Member

Best to ask usage questions on stackoverflow.com to get more eyes on it....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants