This change fixes "Logging templates should be constant" (id = csharpsquid:S2629) identified by sonar.
Details
Using string formatting or concatenation for log messages can lead to performance issues and, in extreme cases, potential security risks, such as log injection. The fix involves using templated log messages, which improve performance by deferring message construction until necessary and enhance security by preventing unintended data interpolation.
I have additional improvements ready for this repo! If you want to see them, leave the comment:
✨✨✨
Remediation
This change fixes "Logging templates should be constant" (id = csharpsquid:S2629) identified by sonar.
Details
Using string formatting or concatenation for log messages can lead to performance issues and, in extreme cases, potential security risks, such as log injection. The fix involves using templated log messages, which improve performance by deferring message construction until necessary and enhance security by preventing unintended data interpolation.
I have additional improvements ready for this repo! If you want to see them, leave the comment:
... and I will open a new PR right away!
🧚🤖 Powered by Pixeebot
Enhanced with AI
Learn moreFeedback | Community | Docs | Codemod ID: sonar:dotnet/templated-logging