activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [2/2] activemq-artemis git commit: [ARTEMIS-1226] Log messages without prefixed id code in artemis-jms-client
Date Mon, 12 Jun 2017 17:51:17 GMT
[ARTEMIS-1226] Log messages without prefixed id code in artemis-jms-client


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6ddeb96a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6ddeb96a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6ddeb96a

Branch: refs/heads/master
Commit: 6ddeb96a8a8ddf70028973e47cab5df3cb3d3972
Parents: 90edd57
Author: Dmitrii Tikhomirov <dtikhomi@redhat.com>
Authored: Mon Jun 12 13:24:57 2017 +0200
Committer: Justin Bertram <jbertram@apache.org>
Committed: Mon Jun 12 12:39:33 2017 -0500

----------------------------------------------------------------------
 .../activemq/artemis/core/client/ActiveMQClientLogger.java  | 9 +++++++++
 .../artemis/jms/client/ActiveMQMessageConsumer.java         | 2 +-
 .../org/apache/activemq/artemis/jndi/ReadOnlyContext.java   | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6ddeb96a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
index 748e508..6382147 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
@@ -315,6 +315,11 @@ public interface ActiveMQClientLogger extends BasicLogger {
       format = Message.Format.MESSAGE_FORMAT)
    void timeoutStreamingLargeMessage();
 
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212058, value = "Unable to get a message.",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToGetMessage(@Cause Exception e);
+
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT)
    void onMessageError(@Cause Throwable e);
@@ -442,4 +447,8 @@ public interface ActiveMQClientLogger extends BasicLogger {
    @Message(id = 214029, value = "Unexpected response from HTTP server: %s")
    void unexpectedResponseFromHttpServer(Object response);
 
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214030, value = "Failed to bind {0}={1}", format = Message.Format.MESSAGE_FORMAT)
+   void failedToBind(String p1, String p2, @Cause Throwable cause);
+
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6ddeb96a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java
b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java
index 1af2aa6..3d7fa56 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java
@@ -229,7 +229,7 @@ public final class ActiveMQMessageConsumer implements QueueReceiver, TopicSubscr
                // nothing better than keep it for future investigations in case it happened
again
                IndexOutOfBoundsException newIOOB = new IndexOutOfBoundsException(ioob.getMessage()
+ "@" + jmsMsg.getCoreMessage());
                newIOOB.initCause(ioob);
-               ActiveMQClientLogger.LOGGER.warn(newIOOB.getMessage(), newIOOB);
+               ActiveMQClientLogger.LOGGER.unableToGetMessage(newIOOB);
                throw ioob;
             }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6ddeb96a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java
b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java
index 0fb6269..d032d07 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java
@@ -101,7 +101,7 @@ public class ReadOnlyContext implements Context, Serializable {
             try {
                internalBind(binding.getKey(), binding.getValue());
             } catch (Throwable e) {
-               ActiveMQClientLogger.LOGGER.error("Failed to bind " + binding.getKey() + "="
+ binding.getValue(), e);
+               ActiveMQClientLogger.LOGGER.failedToBind(binding.getKey(), binding.getValue().toString(),
e);
             }
          }
       }


Mime
View raw message