@@ -207,22 +207,22 @@ The following list shows the order of precedence for logging configuration:
207207
208208[ !INCLUDE[ ] ( ~/fundamentals/http-logging/includes/index-6-7.md )]
209209
210- :::moniker range=">= aspnetcore-10 .0"
210+ :::moniker range=">= aspnetcore-9 .0"
211211
212212## Redacting sensitive data
213213
214214Http logging with redaction can be enabled by calling ` AddHttpLoggingRedaction ` <!-- Microsoft.Extensions.DependencyInjection.HttpLoggingServiceCollectionExtensions.AddHttpLoggingRedaction> --> :
215215
216- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet7&highlight=9 )]
216+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet7&highlight=9 )]
217217
218218For more information about .NET's data redaction library, see [ Data redaction in .NET] ( /dotnet/core/extensions/data-redaction ) .
219219
220220## Logging redaction options
221221
222222To configure options for logging with redaction, call ` AddHttpLoggingRedaction ` <!-- Microsoft.Extensions.DependencyInjection.HttpLoggingServiceCollectionExtensions.AddHttpLoggingRedaction>--> in ` Program.cs ` , using the lambda to configure <!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions>--> ` LoggingRedactionOptions ` :
223223
224- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/MyTaxonomyClassifications.cs )]
225- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=6 )]
224+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/MyTaxonomyClassifications.cs )]
225+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=6 )]
226226
227227With the previous redaction configuration, the output is similar to the following:
228228
@@ -254,53 +254,55 @@ info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
254254<!-- Microsoft.AspNetCore.Diagnostics.Logging.IncomingPathLoggingMode.Structured> -->
255255* ` Structured ` logs the request path with parameters included.
256256
257- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=9 )]
257+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=9 )]
258258
259259### RequestPathParameterRedactionMode
260260
261261<!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.RequestPathParameterRedactionMode> -->
262- ` RequestPathParameterRedactionMode ` specifies how route parameters in the request path should be redacted, whether ` Strict ` or ` None ` .
262+ ` RequestPathParameterRedactionMode ` specifies how route parameters in the request path should be redacted, whether ` Strict ` , ` Loose ` , or ` None ` .
263263
264264<!-- Microsoft.AspNetCore.Diagnostics.Logging.HttpRouteParameterRedactionMode.Strict>-->
265- * ` Strict ` : request route parameters are considered as sensitive and are redacted by default.
265+ * ` Strict ` : Request route parameters are considered sensitive, require explicit annotation with a data classification, and are redacted by default.
266+ <!-- Microsoft.AspNetCore.Diagnostics.Logging.HttpRouteParameterRedactionMode.Loose>-->
267+ * ` Loose ` : All parameters are considered as non-sensitive and included as-is by default.
266268<!-- Microsoft.AspNetCore.Diagnostics.Logging.HttpRouteParameterRedactionMode.None>-->
267- * ` None ` : request route parameters are considered as non-sensitive and logged as-is by default .
269+ * ` None ` : Route parameters aren't redacted regardless of the presence of data classification annotations .
268270
269- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=8 )]
271+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=8 )]
270272
271273### RequestHeadersDataClasses
272274
273275<!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.RequestHeadersDataClasses>-->
274276` RequestHeadersDataClasses ` maps request headers to their data classification, which determines how they are redacted:
275277
276- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=10 )]
278+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=10 )]
277279
278280### ResponseHeadersDataClasses
279281
280282<!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.ResponseHeadersDataClasses>-->
281283` ResponseHeadersDataClasses ` , similar to <!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.RequestHeadersDataClasses>--> ` RequestHeadersDataClasses ` , but for response headers:
282284
283- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=11 )]
285+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=11 )]
284286
285287### RouteParameterDataClasses
286288
287289<!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.RouteParameterDataClasses>-->
288290` RouteParameterDataClasses ` maps route parameters to their data classification:
289291
290- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=12,13,14,15 )]
292+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=12,13,14,15 )]
291293
292294### ExcludePathStartsWith
293295
294296<!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.ExcludePathStartsWith>-->
295297` ExcludePathStartsWith ` specifies paths that should be excluded from logging entirely:
296298
297- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=16,17 )]
299+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=16,17 )]
298300
299301### IncludeUnmatchedRoutes
300302
301303<!-- Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions.IncludeUnmatchedRoutes>-->
302304` IncludeUnmatchedRoutes ` allows reporting unmatched routes. If set to ` true ` , logs whole path of routes not identified by [ Routing] ( xref:fundamentals/routing ) instead of logging ` Unknown ` value for path attribute:
303305
304- [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/8 .x/Program.cs?name=snippet_redactionOptions&highlight=18 )]
306+ [ !code-csharp[ ] ( ~/fundamentals/http-logging/samples/9 .x/Program.cs?name=snippet_redactionOptions&highlight=18 )]
305307
306308::: moniker-end
0 commit comments