You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/logging/index.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,39 @@ In the preceding sample:
132
132
133
133
## Set log level by command line, environment variables, and other configuration
134
134
135
-
Log level can be set by any of the [configuration providers](xref:fundamentals/configuration/index). For information on configuring the logging providers using the command line, environment variables, other file formats, and more, see <xref:fundamentals/configuration/index>.
135
+
Log level can be set by any of the [configuration providers](xref:fundamentals/configuration/index).
* Set the environment key `Logging:LogLevel:Microsoft` to a value of `Information` on Windows.
142
+
* Test the settings when using an app created with the ASP.NET Core web application templates. The `dotnet run` command must be run in the project directory after using `set`.
143
+
144
+
```cmd
145
+
set Logging__LogLevel__Microsoft=Information
146
+
dotnet run
147
+
```
148
+
149
+
The preceding environment setting:
150
+
151
+
* Is only set in processes launched from the command window they were set in.
152
+
* Isn't read by browsers launched with Visual Studio.
153
+
154
+
The following [setx](/windows-server/administration/windows-commands/setx) command also sets the environment key and value on Windows. Unlike `set`, `setx` settings are persisted. The `/M` switch sets the variable in the system environment. If `/M` isn't used, a user environment variable is set.
155
+
156
+
```cmd
157
+
setx Logging__LogLevel__Microsoft=Information /M
158
+
```
159
+
160
+
On [Azure App Service](https://azure.microsoft.com/services/app-service/), select **New application setting** on the **Settings > Configuration** page. Azure App Service application settings are:
161
+
162
+
* Encrypted at rest and transmitted over an encrypted channel.
163
+
* Exposed as environment variables.
164
+
165
+
For more information, see [Azure Apps: Override app configuration using the Azure Portal](xref:host-and-deploy/azure-apps/index#override-app-configuration-using-the-azure-portal).
166
+
167
+
For more information on setting ASP.NET Core configuration values using environment variables, see [environment variables](xref:fundamentals/configuration/index#environment-variables). For information on using other configuration sources, including the command line, Azure Key Vault, Azure App Configuration, other file formats, and more, see <xref:fundamentals/configuration/index>.
0 commit comments