rspec/rules/S6674/why-dotnet.adoc
github-actions[bot] b15413d6bb
Create rule S6674: Log message template should be syntactically correct (#2574)
* Create rule S6674 for C#

---------

Co-authored-by: martin-strecker-sonarsource <martin-strecker-sonarsource@users.noreply.github.com>
Co-authored-by: Martin Strecker <martin.strecker@sonarsource.com>
Co-authored-by: Gregory Paidis <gregory.paidis@sonarsource.com>
Co-authored-by: Gregory Paidis <115458417+gregory-paidis-sonarsource@users.noreply.github.com>
2024-02-29 10:28:22 +00:00

7 lines
637 B
Plaintext

A message template needs to comply with a set of rules. https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-providers[Logging provider] parse the template and enrich log entries with the information found in the template. An unparsable message template leads to corrupted log entries and might result in a loss of information in the logs.
The rule covers the following logging frameworks:
* Nuget package - https://www.nuget.org/packages/Serilog[Serilog]
* Nuget package - https://www.nuget.org/packages/NLog[Nlog]
* Nuget package - https://www.nuget.org/packages/Microsoft.Extensions.Logging[Microsoft.Extensions.Logging]