-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
The logging configuration often uses namespaces (or namespace like strings, separated by periods) as category keys.
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}The logging and configuration docs agree on creating environment variables for deep configuration structures.
Logging__LogLevel__Microsoft=Information
But, you can't use a period in a variable or environment variable name in any shell that I know of. It's not disallowed by the spec, apparently, but the various shells seem to avoid period in their implementations.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02
https://tldp.org/LDP/abs/html/gotchas.html
# Logging__LogLevel__Microsoft.Hosting.Lifetime=Information
bash: Logging__LogLevel__Microsoft.Hosting.Lifetime=Information: command not found
So, how do we do this?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 346bbcf3-9f8e-b253-09fe-906195392783
- Version Independent ID: 0e787ac2-1108-1d94-d62f-ccffa93e06c3
- Content: Logging in .NET
- Content Source: docs/core/extensions/logging.md
- Product: dotnet-fundamentals
- GitHub Login: @IEvangelist
- Microsoft Alias: dapine
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 7184a308-a254-9350-a5cd-5bced1f369ae
- Version Independent ID: 726e3bf1-f367-d733-8933-bccc04da0e16
- Content: Logging in .NET Core and ASP.NET Core
- Content Source: aspnetcore/fundamentals/logging/index.md
- Product: aspnet-core
- Technology: aspnetcore-fundamentals
- GitHub Login: @Rick-Anderson
- Microsoft Alias: riande