Modify Rule S667: Update title (#3681)

This commit is contained in:
Costin Zaharia 2024-02-26 09:16:40 +01:00 committed by GitHub
parent 215f6007ad
commit d65d3b3b9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
{ {
"title": "Logging in a catch clause should include the exception", "title": "Logging in a catch clause should pass the caught exception as a parameter.",
"type": "CODE_SMELL", "type": "CODE_SMELL",
"status": "ready", "status": "ready",
"remediation": { "remediation": {

View File

@ -9,3 +9,11 @@ A log entry should contain all the relevant information about the current execut
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerextensions[Logging methods] provide overloads that accept an `Exception` as a parameter and https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerextensions[Logging methods] provide overloads that accept an `Exception` as a parameter and
https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-providers[logging providers] persist the `Exception` in a structured way to facilitate the tracking of system failures. Therefore `Exceptions` should be passed to the logger. https://learn.microsoft.com/en-us/dotnet/core/extensions/logging-providers[logging providers] persist the `Exception` in a structured way to facilitate the tracking of system failures. Therefore `Exceptions` should be passed to the logger.
The rule covers the following logging frameworks:
* Nuget package - https://www.nuget.org/packages/Castle.Core[Castle.Core]
* Nuget package - https://www.nuget.org/packages/Common.Logging.Core[Common.Core]
* Nuget package - https://www.nuget.org/packages/log4net[log4net]
* Nuget package - https://www.nuget.org/packages/NLog[NLog]
* Nuget package - https://www.nuget.org/packages/Microsoft.Extensions.Logging[Microsoft.Extensions.Logging]