Skip to content

Commit 4d464b8

Browse files
authored
Restore missing code example (#35880)
1 parent 74a8eff commit 4d464b8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

aspnetcore/fundamentals/http-logging/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ The following list shows the order of precedence for logging configuration:
212212

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

215-
[!code-csharp[](~/fundamentals/http-logging/samples/9.x/Program.cs?name=snippet7&highlight=9)]
215+
[!code-csharp[](~/fundamentals/http-logging/samples-snapshot/9.x/Program.cs?name=snippet7&highlight=9)]
216216

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// <snippet7>
2+
var builder = WebApplication.CreateBuilder(args);
3+
4+
builder.Services.AddHttpLogging(logging =>
5+
{
6+
logging.LoggingFields = HttpLoggingFields.Duration;
7+
});
8+
9+
builder.Services.AddRedaction();
10+
builder.Services.AddHttpLoggingRedaction(op => { });
11+
// </snippet7>

0 commit comments

Comments
 (0)