This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c302dc  [AMQ-7347] Don't log error in case of topic subscription 
failure. It's useless as the JMX exception is thrown and pollute the log.
     new 93f8ea1  Merge pull request #497 from jbonofre/AMQ-7347
3c302dc is described below

commit 3c302dce33500cd8e36f626af333ce208ebc44a0
Author: jbonofre <[email protected]>
AuthorDate: Wed Mar 4 07:22:10 2020 +0100

    [AMQ-7347] Don't log error in case of topic subscription failure. It's 
useless as the JMX exception is thrown and pollute the log.
---
 .../main/java/org/apache/activemq/broker/region/TopicRegion.java    | 2 +-
 .../java/org/apache/activemq/transport/stomp/ProtocolConverter.java | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
 
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
index 1ea3e62..e145c02 100644
--- 
a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
+++ 
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
@@ -369,7 +369,7 @@ public class TopicRegion extends AbstractRegion {
             answer.init();
             return answer;
         } catch (Exception e) {
-            LOG.error("Failed to create TopicSubscription ", e);
+            LOG.debug("Failed to create TopicSubscription ", e);
             JMSException jmsEx = new JMSException("Couldn't create 
TopicSubscription");
             jmsEx.setLinkedException(e);
             throw jmsEx;
diff --git 
a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
 
b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
index b3deac4..ee39fb3 100644
--- 
a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
+++ 
b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
@@ -257,7 +257,11 @@ public class ProtocolConverter {
         if (command == null) {
             LOG.warn("Exception occurred while processing a command: {}", 
exception.toString());
         } else {
-            LOG.warn("Exception occurred processing: {} -> {}", 
safeGetAction(command), exception.toString());
+            if (exception instanceof JMSException) {
+                LOG.warn("Exception occurred for client {} ({}) processing: {} 
-> {} ({})", connectionInfo.getClientId(), connectionInfo.getClientIp(), 
safeGetAction(command), exception.toString(), ((JMSException) 
exception).getLinkedException().toString());
+            } else {
+                LOG.warn("Exception occurred for client {} ({}) processing: {} 
-> {}", connectionInfo.getClientId(), connectionInfo.getClientIp(), 
safeGetAction(command), exception.toString());
+            }
         }
 
         if (LOG.isDebugEnabled()) {

Reply via email to