The Set log level by command line, environment variables, and other configuration section provides the following example:
setx Logging__Console__LogLevel__Microsoft.Hosting.Lifetime Trace /M
This approach does not work in most Unix shells:
export Logging__Console__LogLevel__Microsoft.Hosting.Lifetime Trace
-bash: export: `Logging__Console__LogLevel__Microsoft.Hosting.Lifetime': not a valid identifier
There is a note about this on a similar page in the .NET documentation. But I had to spend some time to find it.
It would also be useful to add this note to the ASP.NET Core documentation. Or even put documentation about common concepts, such as configuration and logging, in one place to eliminate duplication.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 159037
The Set log level by command line, environment variables, and other configuration section provides the following example:
setx Logging__Console__LogLevel__Microsoft.Hosting.Lifetime Trace /MThis approach does not work in most Unix shells:
There is a note about this on a similar page in the .NET documentation. But I had to spend some time to find it.
It would also be useful to add this note to the ASP.NET Core documentation. Or even put documentation about common concepts, such as configuration and logging, in one place to eliminate duplication.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 159037