Skip to content

Conversation

@abhiramch018
Copy link
Contributor

@abhiramch018 abhiramch018 commented Nov 26, 2025

This PR updates the documentation for CA1873 to align with the current .NET guidance on logging.
Previously, the article recommended using the LoggerMessage pattern. This has now been updated to recommend source-generated logging using the xref:Microsoft.Extensions.Logging.LoggerMessageAttribute attribute, which provides better performance and compile-time validation.

Fixes #50135


Internal previews

📄 File 🔗 Preview link
docs/fundamentals/code-analysis/quality-rules/ca1873.md CA1873: Avoid potentially expensive logging

@abhiramch018 abhiramch018 requested review from a team and gewarren as code owners November 26, 2025 08:43
@dotnetrepoman dotnetrepoman bot added this to the November 2025 milestone Nov 26, 2025
@dotnet-policy-service dotnet-policy-service bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Nov 26, 2025
@abhiramch018
Copy link
Contributor Author

Hi @gewarren,
Could you please review this PR when you get a moment? It’s a small update to align CA1873 documentation with the latest .NET guidance on source-generated logging. Thanks a lot!

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

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CA1873 - Update logging recommendation to source generation

2 participants