You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cs...@apache.org on 2020/03/11 10:49:09 UTC
[activemq] branch activemq-5.15.x updated: AMQ-7301 -
TransportConnector errors should log the root cause
This is an automated email from the ASF dual-hosted git repository.
cshannon pushed a commit to branch activemq-5.15.x
in repository https://gitbox.apache.org/repos/asf/activemq.git
The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
new 57a1a77 AMQ-7301 - TransportConnector errors should log the root cause
57a1a77 is described below
commit 57a1a77abb54e6862d61626d9a2985b84b9975a9
Author: Christopher L. Shannon (cshannon) <ch...@gmail.com>
AuthorDate: Wed Mar 11 06:47:35 2020 -0400
AMQ-7301 - TransportConnector errors should log the root cause
---
.../main/java/org/apache/activemq/broker/TransportConnector.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
index a8f9359..f07584f 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java
@@ -26,6 +26,7 @@ import java.util.regex.Pattern;
import javax.management.ObjectName;
+import com.google.common.base.Throwables;
import org.apache.activemq.broker.jmx.ManagedTransportConnector;
import org.apache.activemq.broker.jmx.ManagementContext;
import org.apache.activemq.broker.region.ConnectorStatistics;
@@ -242,11 +243,9 @@ 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.debug("Could not accept connection from {}: {}", remoteHost, error.getMessage());
+ LOG.warn("Could not accept connection from {}: {}", (remoteHost == null ? "" : "from " + remoteHost), error.getMessage());
+ LOG.warn("Root cause of connection error: {}", Throwables.getRootCause(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());
- }
}
}
});