docs
docs copied to clipboard
Dont understand why - and would like to.
Article says "When performing logging, it's desirable to preserve the structure of the log (including placeholder names) along with the placeholder values. Preserving this information allows for better observability and search in log aggregation and monitoring software." It would be beneficial to understand why. Seems like the log "receives" a string. Want to understand how sending an interpolated string could "lower observability".
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: f5662dc7-dcf6-47d5-9340-55b22ebfeca8
- Version Independent ID: 0df9ae80-f763-ba60-a876-a98e86d64887
- Content: CA2254: Template should be a static expression - .NET
- Content Source: docs/fundamentals/code-analysis/quality-rules/ca2254.md
- Product: dotnet-fundamentals
- GitHub Login: @Youssef1313
- Microsoft Alias: gewarren
Hi @psiservices-andrewfreese - thank you for posting this issue, we really appreciate it. These error articles focus on the general case for the error, but not specific situations that cause them so to speak. With that said, see: .NET Docs, Logging in .NET: Log message template formatting. Using string interpolation in the logging APIs is a performance issue.