Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,22 +211,22 @@ private static class Log
// These are separate so they can have different log levels
private static readonly string HealthCheckEndText = "Health check {HealthCheckName} with status {HealthStatus} completed after {ElapsedMilliseconds}ms with message '{HealthCheckDescription}'";

private static readonly Action<ILogger, string, double, HealthStatus, string?, Exception?> _healthCheckEndHealthy = LoggerMessage.Define<string, double, HealthStatus, string?>(
private static readonly Action<ILogger, string, HealthStatus, double, string?, Exception?> _healthCheckEndHealthy = LoggerMessage.Define<string, HealthStatus, double, string?>(
LogLevel.Debug,
EventIds.HealthCheckEnd,
HealthCheckEndText);

private static readonly Action<ILogger, string, double, HealthStatus, string?, Exception?> _healthCheckEndDegraded = LoggerMessage.Define<string, double, HealthStatus, string?>(
private static readonly Action<ILogger, string, HealthStatus, double, string?, Exception?> _healthCheckEndDegraded = LoggerMessage.Define<string, HealthStatus, double, string?>(
LogLevel.Warning,
EventIds.HealthCheckEnd,
HealthCheckEndText);

private static readonly Action<ILogger, string, double, HealthStatus, string?, Exception?> _healthCheckEndUnhealthy = LoggerMessage.Define<string, double, HealthStatus, string?>(
private static readonly Action<ILogger, string, HealthStatus, double, string?, Exception?> _healthCheckEndUnhealthy = LoggerMessage.Define<string, HealthStatus, double, string?>(
LogLevel.Error,
EventIds.HealthCheckEnd,
HealthCheckEndText);

private static readonly Action<ILogger, string, double, HealthStatus, string?, Exception?> _healthCheckEndFailed = LoggerMessage.Define<string, double, HealthStatus, string?>(
private static readonly Action<ILogger, string, HealthStatus, double, string?, Exception?> _healthCheckEndFailed = LoggerMessage.Define<string, HealthStatus, double, string?>(
LogLevel.Error,
EventIds.HealthCheckEnd,
HealthCheckEndText);
Expand Down Expand Up @@ -256,15 +256,15 @@ public static void HealthCheckEnd(ILogger logger, HealthCheckRegistration regist
switch (entry.Status)
{
case HealthStatus.Healthy:
_healthCheckEndHealthy(logger, registration.Name, duration.TotalMilliseconds, entry.Status, entry.Description, null);
_healthCheckEndHealthy(logger, registration.Name, entry.Status, duration.TotalMilliseconds, entry.Description, null);
break;

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

case HealthStatus.Unhealthy:
_healthCheckEndUnhealthy(logger, registration.Name, duration.TotalMilliseconds, entry.Status, entry.Description, entry.Exception);
_healthCheckEndUnhealthy(logger, registration.Name, entry.Status, duration.TotalMilliseconds, entry.Description, entry.Exception);
break;
}
}
Expand Down