Skip to content

Adding sections about logging sensitive information #46492

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mariamgerges
Copy link
Contributor

@mariamgerges mariamgerges commented May 30, 2025

Summary

Describe your changes here.

Fixes #Issue_Number (if available)


Internal previews

📄 File 🔗 Preview link
docs/core/extensions/data-redaction.md docs/core/extensions/data-redaction
docs/core/extensions/logger-message-generator.md docs/core/extensions/logger-message-generator

@mariamgerges mariamgerges requested review from IEvangelist and a team as code owners May 30, 2025 10:18
@dotnetrepoman dotnetrepoman bot added this to the May 2025 milestone May 30, 2025
@mariamgerges mariamgerges requested a review from dariusclay May 30, 2025 10:20
@mariamgerges
Copy link
Contributor Author

mariamgerges commented May 30, 2025

@IEvangelist can you please check these updates? and let me know your thoughts
@dariusclay please check and let me know too :)

### Steps for logging sensitive data

1. **Install logging extensions package**: Install [Microsoft.Extensions.Telemetry](https://www.nuget.org/packages/Microsoft.Extensions.Telemetry) to be able to use the extended logger to enable redaction feature.
2. **Setup redaction**: Integrate redactors with your logging pipeline by calling <xref:Microsoft.Extensions.DependencyInjection.RedactionServiceCollectionExtensions.AddRedaction(Microsoft.Extensions.DependencyInjection.IServiceCollection)> method, to automatically sanitize or mask sensitive fields before they are written to logs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. **Setup redaction**: Integrate redactors with your logging pipeline by calling <xref:Microsoft.Extensions.DependencyInjection.RedactionServiceCollectionExtensions.AddRedaction(Microsoft.Extensions.DependencyInjection.IServiceCollection)> method, to automatically sanitize or mask sensitive fields before they are written to logs.
2. **Set up redaction**: Integrate redactors with your logging pipeline by calling the <xref:Microsoft.Extensions.DependencyInjection.RedactionServiceCollectionExtensions.AddRedaction(Microsoft.Extensions.DependencyInjection.IServiceCollection)> method, to automatically sanitize or mask sensitive fields before they are written to logs.


1. **Install logging extensions package**: Install [Microsoft.Extensions.Telemetry](https://www.nuget.org/packages/Microsoft.Extensions.Telemetry) to be able to use the extended logger to enable redaction feature.
2. **Setup redaction**: Integrate redactors with your logging pipeline by calling <xref:Microsoft.Extensions.DependencyInjection.RedactionServiceCollectionExtensions.AddRedaction(Microsoft.Extensions.DependencyInjection.IServiceCollection)> method, to automatically sanitize or mask sensitive fields before they are written to logs.
3. **Identify sensitive fields**: Know which data in your application is sensitive and requires protection, mark them with appropriate data classification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
3. **Identify sensitive fields**: Know which data in your application is sensitive and requires protection, mark them with appropriate data classification.
3. **Identify sensitive fields**: Know which data in your application is sensitive and requires protection, and mark them with appropriate data classification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants