[AMQ-7301] Improve logging when initialize Stomp NIO SSL connection

This commit is contained in:
jbonofre 2020-03-05 07:54:28 +01:00
parent c0e7949468
commit b60efeaad8
2 changed files with 6 additions and 2 deletions

View File

@ -241,8 +241,11 @@ public class TransportConnector implements Connector, BrokerServiceAware {
if (brokerService != null && brokerService.isStopping()) {
LOG.info("Could not accept connection during shutdown {} : {}", (remoteHost == null ? "" : "from " + remoteHost), error.getLocalizedMessage());
} else {
LOG.warn("Could not accept connection {} : {}", (remoteHost == null ? "" : "from " + remoteHost), error.getLocalizedMessage());
LOG.debug("Could not accept connection from {}: {}", remoteHost, error.getMessage());
LOG.debug("Reason: " + error.getMessage(), error);
if (error != null && error.getMessage() != null && remoteHost != null) {
LOG.warn("Could not accept connection from {}: {}", remoteHost, error.toString());
}
}
}
});

View File

@ -26,6 +26,7 @@ import java.security.cert.X509Certificate;
import javax.net.SocketFactory;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLHandshakeException;
import org.apache.activemq.transport.nio.NIOSSLTransport;
import org.apache.activemq.wireformat.WireFormat;
@ -64,7 +65,7 @@ public class StompNIOSSLTransport extends NIOSSLTransport {
serviceRead();
}
} catch (IOException e) {
LOGGER.warn("Could not initialize connection from {}", socket.getInetAddress().getHostAddress(), e);
LOGGER.warn("Could not initialize connection from {}: {} ({})", socket.getInetAddress().getHostAddress(), e.getMessage(), e.getCause().getMessage());
}
}