Open WernerMairl opened 2 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
label: area-Extensions-Logging label: area-Extension-Configurations
sorry may be i have created a duplicate for this: https://github.com/dotnet/runtime/issues/35989 but we should find a solution or at least a better documentation....
Tagging @maryamariyan since the bot didn't.
for me it looks like the "_" must be re-translated somewhere into "." before it goes into the LoggerRuleSelector
Is it _
or double underscore __
?
Would be good if you could please share a repro sample to help try the different cases you shared here.
Hi, we cannot provide log levels via Azure AppService -> Configuration -> Application settings since as stated in the documentation
App setting names can't contain periods (.). If an app setting contains a period, the period is replaced with an underscore in the container.
https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal
For example according to the documentation https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-7.0 we need to provide the following environment variable: LoggingConsoleLogLevel__Microsoft.Hosting.Lifetime but dots are replaced with underscores so logging level is not applied.
Are there any workarounds for this issue?
@pavel-agarkov can you try the workaround mentioned in the comment https://github.com/dotnet/runtime/issues/87130#issuecomment-1583859511
@tarekgh yes, we did something similar to that already. thank you.
Description
May be I'm doing something wrong, so any help is welcome....
I have up and running a asp net core app (5.0.11) with Microsoft.Extensions.Logging in place (a really small default configuration).
The issue occurs only on my Azure AppService Alpine (Linux!) instance!
I like to change logfilter by category for debugging and tracing.... I have category hierarchies like "A.B.C.D" I like to filter for parts of the hierarchs like "A.B" or "A.B.C"
I'm NOT able to change loglevel behavior via Environmnet Variable on Linux for Category "A.B" (DOT part of the hierarchy!
I know that Linux has different behavior in Environment variables => ":" translated into double-underscore => works! => "." translated into single-underscore => seems to have NO impact to the LogFilter engine...
I'm using IConfigurationRoot.DebugView to print out my logging configuration. and it looks in the following way:
(same behavior for Console and ApplicationInsights)
for me it looks like the "_" must be re-translated somewhere into "." before it goes into the LoggerRuleSelector
May be this is a known bug (i remember a few not solvable issues in core 2.0 and 3)
regards Werner
Reproduction Steps
Expected behavior
LogFilter should be working
Actual behavior
LogFilter Ignored
Regression?
No response
Known Workarounds
No response
Configuration
asp-net-core 5 runtime alpine container hosted as Azure App Service
Other information
No response