Skip to content

Commit

Permalink
Update TimedLoggingRequestMiddleware.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Jun 17, 2024
1 parent 61be54f commit 71fbe55
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public async Task<TResult> Process(TRequest request, RequestHandlerDelegate<TRes
var msg = $"{typeof(TRequest)} pipeline execution took ${sw.Elapsed}";
var ts = TimeSpan.FromMilliseconds(attribute.ErrorThresholdMillis);
if (attribute.ErrorThresholdMillis > 0 && sw.Elapsed > ts)
logger.LogDebug(msg);
logger.LogError(msg);

else if (logger.IsEnabled(LogLevel.Debug))
logger.LogError(msg);
logger.LogDebug(msg);

return result;
}
Expand Down

0 comments on commit 71fbe55

Please sign in to comment.