Skip to content

Conversation

@tdykstra
Copy link
Contributor

@tdykstra tdykstra commented Aug 2, 2025

Fixes #35809


Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/http-logging/index.md HTTP logging in ASP.NET Core

@tdykstra tdykstra marked this pull request as ready for review August 2, 2025 22:50
@tdykstra tdykstra requested a review from Copilot August 2, 2025 22:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restores a missing code example for HTTP logging with redaction by creating a new code snippet file and updating the documentation reference to point to the correct location.

  • Adds a new code snippet file (samples-snapshot/9.x/Program.cs) containing HTTP logging configuration examples
  • Updates the documentation to reference the correct code snippet file path

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
aspnetcore/fundamentals/http-logging/samples-snapshot/9.x/Program.cs New file containing HTTP logging configuration code snippets with redaction examples
aspnetcore/fundamentals/http-logging/index.md Updates code snippet reference from samples/9.x/ to samples-snapshot/9.x/ path

{
logging.LoggingFields = HttpLoggingFields.Duration;
});
builder.Services.AddHttpLoggingInterceptor<SampleHttpLoggingInterceptor>();
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code references SampleHttpLoggingInterceptor but this class is not defined or imported. This will cause a compilation error when users try to use this code example.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@wadepickett wadepickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approved. @tdykstra, you might consider updating the ms.date.

@@ -0,0 +1,12 @@
// <snippet7>
// <snippet4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove snippet4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed snippet4

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

[!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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

highlight seems to be wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlight fixed

@tdykstra tdykstra merged commit 4d464b8 into dotnet:main Aug 4, 2025
3 checks passed
@tdykstra tdykstra deleted the snippet7 branch August 4, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code sample not showing in HttpLogging

3 participants