Skip to content

HealthCheck Logging incorrectly passes ElapsedMillisecond and HealthStatus parameters #32523

@mettelephant

Description

@mettelephant

Describe the bug

In the .NET 6.0 beta builds, health check logging lists elapsed milliseconds where status should be. This appears to be due to the change implemented by #26575 adjusted the format string but not the parameters passed to the log message.

The parameters are passed in here: https://github.com/dotnet/aspnetcore/blob/v6.0.0-preview.3.21201.13/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs#L253 and duration.TotalMilliseconds just needs to be replaced with entry.Status

To Reproduce

Start with an aspnet project using .NET 6, add a health check endpoint. Start the project and hit the health check endpoint.

Exceptions (if any)

Further technical details

  • ASP.NET Core version: .NET 6

.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.2.21155.3
Commit: 1a9103db2d

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.2.21155.3\

Host (useful for support):
Version: 6.0.0-preview.2.21154.6
Commit: 3eaf1f316b

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-healthchecksIncludes: Healthchecks (some bugs also in Extensions repo)bugThis issue describes a behavior which is not expected - a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions