Calls to Log.LogError(Exception) if an exception occurs during a health check.
Why is this needed:
Currently, if an exception occurs during a health check, the exception will be included in the HealthCheckResult but nothing further happens to notify of the exception, causing it to be ignored. This makes troubleshooting difficult when there's only the word Unhealthy to go on.
What would you like to be added:
Calls to
Log.LogError(Exception)
if an exception occurs during a health check.Why is this needed:
Currently, if an exception occurs during a health check, the exception will be included in the
HealthCheckResult
but nothing further happens to notify of the exception, causing it to be ignored. This makes troubleshooting difficult when there's only the wordUnhealthy
to go on.https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/2f6a10f89e3c6d97f232f4157a80e3a9e1470dc5/src/HealthChecks.AzureServiceBus/AzureServiceBusQueueHealthCheck.cs#L25-L37
Proposed change:
Add a call to
log.LogError(ex)
to log the exception viaILogger<T>
, like this:I'm happy to PR this if you think it's a good change. Thanks!