Skip to content

Commit 42bfe90

Browse files
author
R9 Fundamentals
committed
fix
1 parent 67d561d commit 42bfe90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

aspnetcore/fundamentals/http-logging/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,16 @@ The following list shows the order of precedence for logging configuration:
211211

212212
Http logging with redaction can be enabled by calling <xref:Microsoft.Extensions.DependencyInjection.HttpLoggingServiceCollectionExtensions.AddHttpLoggingRedaction>.
213213

214-
[!code-csharp[](~/fundamentals/http-logging/samples/8.x/Program.cs?name=snippet6&highlight=6)]
214+
[!code-csharp[](~/fundamentals/http-logging/samples/8.x/Program.cs?name=snippet7&highlight=10)]
215215

216216
For more information about .NET's data redaction library, see [Data redaction in .NET](/dotnet/core/extensions/data-redaction).
217217

218218
## Logging redaction options
219219

220220
To configure options for logging with redaction, call <xref:Microsoft.Extensions.DependencyInjection.HttpLoggingServiceCollectionExtensions.AddHttpLoggingRedaction> in `Program.cs`, using the lambda to configure <xref:Microsoft.AspNetCore.Diagnostics.Logging.LoggingRedactionOptions>.
221221

222-
[!code-csharp[](~/fundamentals/http-logging/samples/8.x/Program.cs?name=snippet_redactionOptions)]
223222
[!code-csharp[](~/fundamentals/http-logging/samples/8.x/MyTaxonomyClassifications.cs)]
223+
[!code-csharp[](~/fundamentals/http-logging/samples/8.x/Program.cs?name=snippet_redactionOptions)]
224224

225225
Given this configuration, this is the expected output:
226226

aspnetcore/fundamentals/http-logging/samples/8.x/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
// <snippet3>
108108
using HttpLoggingSample;
109109
using Microsoft.AspNetCore.HttpLogging;
110-
// <snippet6>
110+
// <snippet7>
111111
// <snippet4>
112112
var builder = WebApplication.CreateBuilder(args);
113113

@@ -119,7 +119,7 @@
119119
// </snippet4>
120120
builder.Services.AddRedaction();
121121
builder.Services.AddHttpLoggingRedaction(op => { });
122-
// </snippet6>
122+
// </snippet7>
123123
var app = builder.Build();
124124

125125
if (!app.Environment.IsDevelopment())

0 commit comments

Comments
 (0)