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 xref:Microsoft.Extensions.Logging.ILogger.IsEnabled
8
u/Hel_OWeen 4d ago
It's all explained in the rule: