Sonarqube: server community v25.9.0.112764
Language: csharp
Rule: S6664 Reduce the number of Debug logging calls within this code block
I think this rule should exclude trace-level logs.
The purpose of trace-level logging is to help developpers understand how the execution flows accross their code. As a developper your are supposed to place quite a large numbers of them by design, especially for methods which implement sequences of operations.
How to reproduce?
try {
logger.LogTrace(Constants.Progress.ProgressAuthentication);
context.Authentication = await authenticationService.GetAuthentication(context.Tenant, source.Token).ConfigureAwait(false);
logger.LogTrace(Constants.Progress.ProgressKey);
context.Key = await keyService.GetByCustomer(context.Authentication.Customer, source.Token).ConfigureAwait(false);
logger.LogTrace(Constants.Progress.ProgressDownload);
context.Directory = await payloadService.DownloadPayload(context.Operation, context.Tenant, source.Token).ConfigureAwait(false);
logger.LogTrace(Constants.Progress.ProgressMetadata);
context.Metadata = await payloadService.ReadMetadata(context.Directory, source.Token).ConfigureAwait(false);
logger.LogTrace(Constants.Progress.ProgressUpload);
context.SendDate = DateTimeOffset.UtcNow;
await remoteService.UploadPayload(context.Directory, source.Token).ConfigureAwait(false);
logger.LogTrace(Constants.Progress.ProgressSuccess);
await payloadService.NotifySuccess(context, cancellationToken).ConfigureAwait(false);
} catch(Exception exception) {
// do stuff
}