AMQ-4706 - ensure we log the first warn and include the failure reason

This commit is contained in:
gtully 2018-07-05 17:34:30 +01:00
parent d8c939a4bd
commit 2b64b7b04f

View File

@ -1096,9 +1096,9 @@ public class FailoverTransport implements CompositeTransport {
}
int warnInterval = getWarnAfterReconnectAttempts();
if (warnInterval > 0 && (connectFailures % warnInterval) == 0) {
LOG.warn("Failed to connect to {} after: {} attempt(s) continuing to retry.",
uris, connectFailures);
if (warnInterval > 0 && (connectFailures == 1 || (connectFailures % warnInterval) == 0)) {
LOG.warn("Failed to connect to {} after: {} attempt(s) with {}, continuing to retry.",
uris, connectFailures, (failure == null ? "?" : failure.getLocalizedMessage()));
}
}