-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
area-healthchecksIncludes: Healthchecks (some bugs also in Extensions repo)Includes: Healthchecks (some bugs also in Extensions repo)
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Health checks reuses a logging ID and name for end events at different log levels. We don't do this anywhere else in ASP.NET Core.
aspnetcore/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs
Lines 220 to 229 in 4535ea1
#pragma warning disable SYSLIB1006 | |
[LoggerMessage(EventIds.HealthCheckEndId, LogLevel.Debug, HealthCheckEndText, EventName = EventIds.HealthCheckEndName)] | |
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, 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); | |
#pragma warning restore SYSLIB1006 |
Expected Behavior
I think we should have different log messages for different events to be consistent with the rest of the logging.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-healthchecksIncludes: Healthchecks (some bugs also in Extensions repo)Includes: Healthchecks (some bugs also in Extensions repo)