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-1228] Log messages without prefixed id code in artemis-rest
Date Mon, 12 Jun 2017 18:02:28 GMT
[ARTEMIS-1228] Log messages without prefixed id code in artemis-rest


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

Branch: refs/heads/master
Commit: e6ba3fbc71cd9e28ba0581dc69b9940a05332466
Parents: 59ce313
Author: Dmitrii Tikhomirov <dtikhomi@redhat.com>
Authored: Mon Jun 12 15:50:29 2017 +0200
Committer: Justin Bertram <jbertram@apache.org>
Committed: Mon Jun 12 13:02:14 2017 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/rest/ActiveMQRestLogger.java | 8 ++++++++
 .../apache/activemq/artemis/rest/queue/push/UriStrategy.java | 2 +-
 .../apache/activemq/artemis/rest/util/HttpMessageHelper.java | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e6ba3fbc/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/ActiveMQRestLogger.java
----------------------------------------------------------------------
diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/ActiveMQRestLogger.java
b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/ActiveMQRestLogger.java
index 524a9fd..dbca778 100644
--- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/ActiveMQRestLogger.java
+++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/ActiveMQRestLogger.java
@@ -64,6 +64,14 @@ public interface ActiveMQRestLogger extends BasicLogger {
    @Message(id = 182001, value = "shutdown REST subscription because of timeout for: {0}",
format = Message.Format.MESSAGE_FORMAT)
    void shutdownRestSubscription(String id);
 
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 182002, value = "Failed to push message to {0}", format = Message.Format.MESSAGE_FORMAT)
+   void failedToPushMessageToUri(String uri, @Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 182003, value = "Failed to build Message from object", format = Message.Format.MESSAGE_FORMAT)
+   void failedToBuildMessageFromObject(@Cause Exception e);
+
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 184000, value = "Failed to load push store {0}, it is probably corrupted",
format = Message.Format.MESSAGE_FORMAT)
    void errorLoadingStore(@Cause Exception e, String name);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e6ba3fbc/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/UriStrategy.java
----------------------------------------------------------------------
diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/UriStrategy.java
b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/UriStrategy.java
index 10c01d6..591c8e2 100644
--- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/UriStrategy.java
+++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/queue/push/UriStrategy.java
@@ -175,7 +175,7 @@ public class UriStrategy implements PushStrategy {
                }
             }
          } catch (Exception e) {
-            ActiveMQRestLogger.LOGGER.warn("failed to push message to " + uri, e);
+            ActiveMQRestLogger.LOGGER.failedToPushMessageToUri(uri, e);
             return false;
          } finally {
             if (res != null)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e6ba3fbc/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/HttpMessageHelper.java
----------------------------------------------------------------------
diff --git a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/HttpMessageHelper.java
b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/HttpMessageHelper.java
index a6e4c8e..b04ba37 100644
--- a/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/HttpMessageHelper.java
+++ b/artemis-rest/src/main/java/org/apache/activemq/artemis/rest/util/HttpMessageHelper.java
@@ -83,7 +83,7 @@ public class HttpMessageHelper {
                ActiveMQRestLogger.LOGGER.debug("**** Building Message from object: " + obj.toString());
                request.body(contentType, obj);
             } catch (Exception e) {
-               ActiveMQRestLogger.LOGGER.warn("Building Message from object", e.getMessage(),
e);
+               ActiveMQRestLogger.LOGGER.failedToBuildMessageFromObject(e);
                throw new RuntimeException(e);
             }
          }


Mime
View raw message