WriteTo.Seq(..) doesn't respect MinimumLevel.Override
See original GitHub issueI’m configuring Serilog with Seq like that:
hostBuilder.UseSerilog((builder, loggerConfiguration) =>
{
var env = builder.HostingEnvironment;
var seqConfig = builder.Configuration.GetSection("Seq");
var loggingLevelSwitch = new LoggingLevelSwitch();
loggerConfiguration.MinimumLevel.ControlledBy(loggingLevelSwitch)
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("BeatPulse", LogEventLevel.Warning)
.Enrich.FromLogContext()
.Enrich.WithMachineName()
.Enrich.WithEnvironmentUserName()
.Enrich.WithProperty("Environment", env.EnvironmentName)
.WriteTo.Console()
.WriteTo.Seq(url ?? seqConfig["Url"], apiKey: apiKey ?? seqConfig["ApiKey"], controlLevelSwitch: loggingLevelSwitch);
});
The console sink respects the override and doesn’t prompt messages from Microsoft and BeatPulse. Unfortunately the Seq-Sink does not.
I’m not sure if it’s a wrong config or it isn’t supported yet?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
WriteTo.Seq(..) doesn't respect MinimumLevel.Override #115
I'm configuring Serilog with Seq like that: hostBuilder.UseSerilog((builder, loggerConfiguration) => { var env = builder.
Read more >Overriding MinimumLevel doesn't work in Serilog
1 Answer. You are overriding the MinimumLevel only for log messages sent from a SourceContext with the name LogTest , as per your...
Read more >Serilog 2.1 MinimumLevel.Override()
The Serilog MinimumLevel setting determines at which level log events are generated:
Read more >flx/serilog
Override() runtime optimizations (@skomis-mm) ... #1472 - improve handling of minimum level overrides in sub-loggers (@skomis-mm) ... Sink(sink) / WriteTo.
Read more >Reducing log verbosity with Serilog RequestLogging
In this post I describe how you can use Serilog.AspNetCore to reduce the number of logs generated by every request in ASP.NET Core...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @nblumhardt ! I finally found it. We had multiple clients which logged to the same seq instance (which wasn’t intended in this case). It resulted in a view where you could think that the logging doesn’t work. Infact I looked at messages from a different client. So I have to apologize. It was all my fault. Many thanks for your help and work!
Awesome, glad it turned out to be something simple 👍