diff --git a/aspnetcore/fundamentals/http-logging/index.md b/aspnetcore/fundamentals/http-logging/index.md index 0455181c262b..7a40e3f74532 100644 --- a/aspnetcore/fundamentals/http-logging/index.md +++ b/aspnetcore/fundamentals/http-logging/index.md @@ -212,7 +212,7 @@ The following list shows the order of precedence for logging configuration: Http logging with redaction can be enabled by calling : -[!code-csharp[](~/fundamentals/http-logging/samples/9.x/Program.cs?name=snippet7&highlight=9)] +[!code-csharp[](~/fundamentals/http-logging/samples-snapshot/9.x/Program.cs?name=snippet7&highlight=9)] For more information about .NET's data redaction library, see [Data redaction in .NET](/dotnet/core/extensions/data-redaction). diff --git a/aspnetcore/fundamentals/http-logging/samples-snapshot/9.x/Program.cs b/aspnetcore/fundamentals/http-logging/samples-snapshot/9.x/Program.cs new file mode 100644 index 000000000000..3af11c0693ef --- /dev/null +++ b/aspnetcore/fundamentals/http-logging/samples-snapshot/9.x/Program.cs @@ -0,0 +1,11 @@ +// +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddHttpLogging(logging => +{ + logging.LoggingFields = HttpLoggingFields.Duration; +}); + +builder.Services.AddRedaction(); +builder.Services.AddHttpLoggingRedaction(op => { }); +//