-
Notifications
You must be signed in to change notification settings - Fork 13
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
Minimum level not effective using ILoggingBuilder
configuration
#22
Comments
Hi Cengiz, Turns out, to my surprise, you must call loggingBuilder.SetMinimumLevel(LogLevel.Trace);
loggingBuilder.AddSeq(Configuration.GetSection("Seq")); I don't know whether this is really the expected usage pattern, so digging in a little further. @pakrym, is there any blog post or doc on how minimum level is managed in v2? Cheers! |
ILoggingBuilder
configuration
(Especially - how should this work with level overrides? If I bump up the logging level for |
@nblumhardt https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging?tabs=aspnetcore2x Minimum level is only used when there are no rules matched at all, so if you set |
@pakrym thanks for the follow-up! Does that indicate we're hitting a bug here, then? In my test app, I have the Seq logger set to Trace, and level overrides defined in it for Microsoft and System, but still the global logging level of Information overrides everything else... |
@nblumhardt do you have |
Do now, still not working as I'd expect, but more to dig through. Currently going through the uncomfortable realization that, although there are technically no breaking API changes in 2.0, the entire configuration model used by the Serilog provider, Seq provider, and File provider is now completely broken? Hacking in something like: "Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Information"
},
"Seq": {
"LogLevel": {
"Default": "Trace",
"System": "Information",
"Microsoft": "Warning"
}
}
}, Does the framework recognize custom provider names here? |
If you put |
Thanks for the tip. Without |
@nblumhardt full provider type name would work. |
👍 thanks. Any way we can get access to the logging configuration block, e.g. so that we can include custom data? E.g. "Logging": {
"Seq": {
"ServerUrl": "http://xyz",
"LogLevel": {
"Default": "Trace"
}
}
}, |
Will be there for 2.1 |
|
@nblumhardt we added a way to access provider configuration section in logging configuration: aspnet/Logging#706 |
Thanks @pakrym, will take a look 👍 |
Closing this as I think it's now stale; will open a new ticket for configuration section support |
Make sure you are looking for non-default levels which are Debug and Trace
Program.cs
appsettings.json
ConsoleApp1.csproj
The text was updated successfully, but these errors were encountered: