Skip to content

Commit

Permalink
Log exception in HealthCheckEndDegraded message (#39355)
Browse files Browse the repository at this point in the history
  • Loading branch information
captainsafia committed Jan 6, 2022
1 parent 54ff379 commit 9269dd9
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -223,7 +223,7 @@ private static partial class Log
private static partial void HealthCheckEndHealthy(ILogger logger, string HealthCheckName, HealthStatus HealthStatus, double ElapsedMilliseconds, string? HealthCheckDescription);

[LoggerMessage(EventIds.HealthCheckEndId, LogLevel.Warning, HealthCheckEndText, EventName = EventIds.HealthCheckEndName)]
private static partial void HealthCheckEndDegraded(ILogger logger, string HealthCheckName, HealthStatus HealthStatus, double ElapsedMilliseconds, string? HealthCheckDescription);
private static partial void HealthCheckEndDegraded(ILogger logger, string HealthCheckName, HealthStatus HealthStatus, double ElapsedMilliseconds, string? HealthCheckDescription, Exception? exception);

[LoggerMessage(EventIds.HealthCheckEndId, LogLevel.Error, HealthCheckEndText, EventName = EventIds.HealthCheckEndName)]
private static partial void HealthCheckEndUnhealthy(ILogger logger, string HealthCheckName, HealthStatus HealthStatus, double ElapsedMilliseconds, string? HealthCheckDescription, Exception? exception);
Expand All @@ -238,7 +238,7 @@ public static void HealthCheckEnd(ILogger logger, HealthCheckRegistration regist
break;

case HealthStatus.Degraded:
HealthCheckEndDegraded(logger, registration.Name, entry.Status, duration.TotalMilliseconds, entry.Description);
HealthCheckEndDegraded(logger, registration.Name, entry.Status, duration.TotalMilliseconds, entry.Description, entry.Exception);
break;

case HealthStatus.Unhealthy:
Expand Down

0 comments on commit 9269dd9

Please sign in to comment.