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.

Comment From: pivotal-cla

@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.

Comment From: pivotal-cla

@josephabonasara Thank you for signing the Contributor License Agreement!

Comment From: philwebb

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.