diff --git a/rules/S6667/metadata.json b/rules/S6667/metadata.json index 5dcfdecd7d..5918a20607 100644 --- a/rules/S6667/metadata.json +++ b/rules/S6667/metadata.json @@ -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", "status": "ready", "remediation": { diff --git a/rules/S6667/why-dotnet.adoc b/rules/S6667/why-dotnet.adoc index 43a047b1df..32c021fe57 100644 --- a/rules/S6667/why-dotnet.adoc +++ b/rules/S6667/why-dotnet.adoc @@ -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/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]