diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1873.md b/docs/fundamentals/code-analysis/quality-rules/ca1873.md index 3124289584046..6ae965935c274 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca1873.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca1873.md @@ -30,14 +30,14 @@ In many situations, logging is disabled or set to a log level that results in an ## Rule description -When logging methods are called, their arguments are evaluated regardless of whether the logging level is enabled. This can result in expensive operations being executed even when the log message won't be written. For better performance, guard expensive logging calls with a check to or use the `LoggerMessage` pattern. +When logging methods are called, their arguments are evaluated regardless of whether the logging level is enabled. This can result in expensive operations being executed even when the log message won't be written. For better performance, guard expensive logging calls with a check to or use **source-generated logging** with the attribute. ## How to fix violations To fix a violation of this rule, use one of the following approaches: - Guard the logging call with a check to . -- Use the `LoggerMessage` pattern with . +- Use **source-generated logging** with the attribute for better performance and compile-time safety. - Ensure expensive operations aren't performed in logging arguments unless necessary. ## Example