-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Restore missing code example #35880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore missing code example #35880
Conversation
There was a problem hiding this 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>(); |
Copilot
AI
Aug 2, 2025
There was a problem hiding this comment.
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.
wadepickett
left a comment
There was a problem hiding this 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> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove snippet4?
There was a problem hiding this comment.
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)] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlight fixed
aspnetcore/fundamentals/http-logging/samples-snapshot/9.x/Program.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Brennan <[email protected]>
Fixes #35809
Internal previews