✅ how do logging settings work
i'm trying to change logging settings for another issue, but they doesn't seem to be intuitive or really not even to work like the docs say
shouldn't this filter almost everything?
instead i see even debug logs
there are no other settings (like other appsettings or environment variables)
it would be really nice if for once i didn't have to look at the source code to understand how it works
7 Replies
hmm should Serilog have the priority over .net?
https://learn.microsoft.com/en-us/dotnet/core/extensions/logging
doc says it filters the logs before sending them to the provider
Logging in C# - .NET
Learn about app logging provided by the Microsoft.Extensions.Logging NuGet package in C#.
the log providers there are just the different sinks. not serilog itself, which is the logging framework and thus needs its own configuration
with ur configuration i would guess that the internal flow would be from
ILogger
to MS.E.Logging as framework to a sink that passes it to the Serilog framework which passes it to Serilog's Console sink
but u probably have set up serilog in the way that its logger factory will be used, so its just their implementations using the MS.E.Logging interfaces
thus the flow would be from ILogger
to Serilog as framework to Serilog's Console sink and thus the MS.E.Logging configuration isnt even looked ati didn't set it up, that's the problem
also in the middle there is abp
i can tell you there is this
and that at least some of these do work
but not enough to have an evident causality
maybe just
"Default"
is being ignored
i dont f know
yeah anyway is something that has to do with two logging frameworks fightingwell, did u try setting up the logging only via serilog as in the linked tutorial?
yes, sure
although in tens of configurations for clients we have never used levels inside the serilog section
serilog states here as well, that its read from the
Serilog
section, i would assume that its not from within the Logging
section
https://github.com/serilog/serilog-settings-configuration#serilogsettingsconfiguration--