Skip to content

Conversation

@josephabonasara
Copy link

Centralize logging for health indicator failures.

  • Add HealthLogger class to centralize logging for health indicator failures.
  • Remove logExceptionIfPresent method from AbstractHealthIndicator and AbstractReactiveHealthIndicator.
  • Update AbstractHealthIndicator and AbstractReactiveHealthIndicator to use HealthLogger.logExceptionIfPresent.
  • Add exception field to Health class and update Builder class to set the exception field.
  • Add getException method to Health class to retrieve the exception.
  • Update HealthEndpointSupport to use HealthLogger.logExceptionIfPresent.
  • Add HealthLoggerTests class to test the HealthLogger class.

Centralize logging for health indicator failures.

* Add `HealthLogger` class to centralize logging for health indicator failures.
* Remove `logExceptionIfPresent` method from `AbstractHealthIndicator` and `AbstractReactiveHealthIndicator`.
* Update `AbstractHealthIndicator` and `AbstractReactiveHealthIndicator` to use `HealthLogger.logExceptionIfPresent`.
* Add `exception` field to `Health` class and update `Builder` class to set the `exception` field.
* Add `getException` method to `Health` class to retrieve the exception.
* Update `HealthEndpointSupport` to use `HealthLogger.logExceptionIfPresent`.
* Add `HealthLoggerTests` class to test the `HealthLogger` class.
@pivotal-cla
Copy link

@josephabonasara Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 23, 2024
@pivotal-cla
Copy link

@josephabonasara Thank you for signing the Contributor License Agreement!

@philwebb
Copy link
Member

Thanks for the pull-request, but I'm afraid this wasn't quite what I had in mind. I should have put the pending-design-work label on that issue to make it clearer that we aren't ready for contributions just yet.

I think what we want to do is remove the logging entirely from the *HealthIndicator classes and instead make the calling code responsible for doing the logging. We're going to need a bit more time to really think about the design and the impact of such a change. I don't think we'll be really ready to start on this one until the new year.

Thanks anyway for your contribution and I'm sorry about any wasted effort.

@philwebb philwebb closed this Dec 23, 2024
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants