Skip to content

Health check logging: ElapsedMilliseconds in messages makes logs harder to process #21608

@espenrl

Description

@espenrl

Disclamer: I think logging the duration of health checks is great.

I also think it should be logged as debug only. The current code logs the duration in warnings and errors too - those who are important to monitor in production. In Splunk we group log messages before creating a daily report. When duration is the only differing factor our reports look like this:

image


Proposal: only include ElapsedMilliseconds in debug messages

And the link to the code

https://github.com/aspnet/Extensions/blob/c3740ed31f55d22c39d49d17b449eb49b8fdffba/src/HealthChecks/HealthChecks/src/DefaultHealthCheckService.cs#L158

Metadata

Metadata

Assignees

No one assigned

    Labels

    DoneThis issue has been fixedarea-healthchecksIncludes: Healthchecks (some bugs also in Extensions repo)help wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions