title: Spring boot, log failing health check
body: <p>We use spring-boot(2.5.6) in kubernetes</p>
  <p>Many of the dependencies we use include healthchecks for instance RedisHealthIndicator,CouchbaseHealthIndicator etc</p>
  <p>When one of these health checks fails and the overall application health fails, the pod is restarted by kubernetes.</p>
  <p>However there is no indication <em>why</em> it failed, spring does not log health check failures, instead relying on the Healthcheck itself to log a message.
  Which is not the case for the built in health checks.</p>
  <p>So from the outside it appears that kubernetes has killed this pod for 'no reason' and we have to assume it was the health check</p>
  <p>Does spring have a 'health check change event' so that I can log which bean has failed?</p>
  <p>Or otherwise track the 'down' state of the health on an individual basis</p>
  <p><a href="https://github.com/spring-projects/spring-boot/issues/22632" rel="nofollow noreferrer">https://github.com/spring-projects/spring-boot/issues/22632</a>
  This issue is similar but they explicitly state they will not log failures</p>