Skip to content

Commit fda2428

Browse files
authored
Clarify logging filter rules example
Fixes #48062. * Reorders to put ApplicationInsights override after the general setting. * Removes duplicate default setting in ApplicationInsights. * Removes `AllowedHosts` setting unrelated to logging, making the example more specifically a "section of" the config as described above the example.
1 parent f97f086 commit fda2428

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

articles/azure-monitor/app/ilogger.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,22 +326,20 @@ The following examples apply filter rules to ApplicationInsightsLoggerProvider.
326326

327327
### Create filter rules in configuration with appsettings.json
328328

329-
For ApplicationInsightsLoggerProvider, the provider alias is `ApplicationInsights`. The following section of *appsettings.json* configures logs for *Warning* and above from all categories and *Error* and above from categories that start with "Microsoft" to be sent to `ApplicationInsightsLoggerProvider`.
329+
For ApplicationInsightsLoggerProvider, the provider alias is `ApplicationInsights`. The following section of *appsettings.json* instructs logging providers generally to log at level *Warning* and above. It then overrides the `ApplicationInsightsLoggerProvider` to log categories that start with "Microsoft" at level *Error* and above.
330330

331331
```json
332332
{
333333
"Logging": {
334+
"LogLevel": {
335+
"Default": "Warning"
336+
},
334337
"ApplicationInsights": {
335338
"LogLevel": {
336-
"Default": "Warning",
337339
"Microsoft": "Error"
338340
}
339-
},
340-
"LogLevel": {
341-
"Default": "Warning"
342341
}
343-
},
344-
"AllowedHosts": "*"
342+
}
345343
}
346344
```
347345

0 commit comments

Comments
 (0)