activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: [ARTEMIS-1311] Log messages without prefixed id code in artemis-core-client
Date Mon, 31 Jul 2017 17:04:41 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master c23c7670e -> 797341035


[ARTEMIS-1311] Log messages without prefixed id code in artemis-core-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/bef3864c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/bef3864c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/bef3864c

Branch: refs/heads/master
Commit: bef3864c722d346cc8698417a13a7c40eac0c2ef
Parents: c23c767
Author: Dmitrii Tikhomirov <dtikhomi@redhat.com>
Authored: Thu Jul 27 14:12:31 2017 +0200
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Jul 31 12:51:15 2017 -0400

----------------------------------------------------------------------
 .../api/core/UDPBroadcastEndpointFactory.java   |  6 +-
 .../artemis/api/core/client/ActiveMQClient.java |  4 +-
 .../core/client/ActiveMQClientLogger.java       | 82 ++++++++++++++++++++
 .../core/client/impl/ClientConsumerImpl.java    |  4 +-
 .../client/impl/ClientSessionFactoryImpl.java   |  4 +-
 .../artemis/core/cluster/DiscoveryGroup.java    |  4 +-
 .../core/impl/RemotingConnectionImpl.java       |  2 +-
 .../artemis/core/remoting/impl/netty/Epoll.java |  5 +-
 .../remoting/impl/netty/NettyConnection.java    |  4 +-
 .../remoting/impl/netty/NettyConnector.java     |  2 +-
 .../activemq/artemis/utils/VersionLoader.java   |  4 +-
 11 files changed, 100 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/UDPBroadcastEndpointFactory.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/UDPBroadcastEndpointFactory.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/UDPBroadcastEndpointFactory.java
index c257ade..c447a8d 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/UDPBroadcastEndpointFactory.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/UDPBroadcastEndpointFactory.java
@@ -155,7 +155,7 @@ public final class UDPBroadcastEndpointFactory implements BroadcastEndpointFacto
                continue;
             } catch (IOException e) {
                if (open) {
-                  ActiveMQClientLogger.LOGGER.warn(this + " getting exception when receiving
broadcasting.", e);
+                  ActiveMQClientLogger.LOGGER.unableToReceiveBroadcast(e, this.toString());
                }
             }
             break;
@@ -262,7 +262,7 @@ public final class UDPBroadcastEndpointFactory implements BroadcastEndpointFacto
          }
          return tmp;
       } catch (Throwable t) {
-         ActiveMQClientLogger.LOGGER.warn(t);
+         ActiveMQClientLogger.LOGGER.unableToGetProperty(t);
          return defaultValue;
       }
    }
@@ -273,7 +273,7 @@ public final class UDPBroadcastEndpointFactory implements BroadcastEndpointFacto
       try {
          return Integer.parseInt(value);
       } catch (Throwable t) {
-         ActiveMQClientLogger.LOGGER.warn(t.getMessage(), t);
+         ActiveMQClientLogger.LOGGER.unableToParseValue(t);
          return Integer.parseInt(defaultValue);
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
index bfb86d0..8fba747 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
@@ -165,7 +165,7 @@ public final class ActiveMQClient {
          try {
             if (!globalThreadPool.awaitTermination(time, unit)) {
                globalThreadPool.shutdownNow();
-               ActiveMQClientLogger.LOGGER.warn("Couldn't finish the client globalThreadPool
in less than 10 seconds, interrupting it now");
+               ActiveMQClientLogger.LOGGER.unableToProcessGlobalThreadPoolIn10Sec();
             }
          } catch (InterruptedException e) {
             throw new ActiveMQInterruptedException(e);
@@ -179,7 +179,7 @@ public final class ActiveMQClient {
          try {
             if (!globalScheduledThreadPool.awaitTermination(time, unit)) {
                globalScheduledThreadPool.shutdownNow();
-               ActiveMQClientLogger.LOGGER.warn("Couldn't finish the client scheduled in
less than 10 seconds, interrupting it now");
+               ActiveMQClientLogger.LOGGER.unableToProcessScheduledlIn10Sec();
             }
          } catch (InterruptedException e) {
             throw new ActiveMQInterruptedException(e);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/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 405ed07..6fbb911 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
@@ -27,6 +27,8 @@ import org.jboss.logging.annotations.Message;
 import org.jboss.logging.annotations.MessageLogger;
 import org.w3c.dom.Node;
 
+import java.net.UnknownHostException;
+
 /**
  * Logger Code 21
  * <p>
@@ -320,6 +322,76 @@ public interface ActiveMQClientLogger extends BasicLogger {
            format = Message.Format.MESSAGE_FORMAT)
    void unableToGetMessage(@Cause Exception e);
 
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212059, value = "Failed to clean up: {0} ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void failedCleaningUp(String target);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212060, value = "Unexpected null data received from DiscoveryEndpoint ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unexpectedNullDataReceived();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212061, value = "Failed to perform force close ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void failedForceClose(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212062, value = "Failed to perform post actions on message processing ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void failedPerformPostActionsOnMessage(@Cause Exception e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212063, value = "Unable to handle connection failure ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToHandleConnectionFailure(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212064, value = "Unable to receive cluster topology ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToReceiveClusterTopology(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212065, value = "{0} getting exception when receiving broadcasting ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToReceiveBroadcast(@Cause Exception e, String target);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212066, value = "failed to parse int property ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToParseValue(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212067, value = "failed to get system property ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToGetProperty(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212068, value = "Couldn't finish the client globalThreadPool in less than
10 seconds, interrupting it now ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToProcessGlobalThreadPoolIn10Sec();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212069, value = "Couldn't finish the client scheduled in less than 10 seconds,
interrupting it now ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToProcessScheduledlIn10Sec();
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212070, value = "Unable to initialize VersionLoader ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToInitVersionLoader(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212071, value = "Unable to check Epoll availability ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToCheckEpollAvailability(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 212072, value = "Failed to change channel state to ReadyForWriting ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void failedToSetChannelReadyForWriting(@Cause Throwable e);
+
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT)
    void onMessageError(@Cause Throwable e);
@@ -454,4 +526,14 @@ public interface ActiveMQClientLogger extends BasicLogger {
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 214031, value = "Failed to decode buffer, disconnect immediately.", format
= Message.Format.MESSAGE_FORMAT)
    void disconnectOnErrorDecoding(@Cause Throwable cause);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214032, value = "Unable to initialize VersionLoader ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToInitVersionLoaderError(@Cause Throwable e);
+
+   @LogMessage(level = Logger.Level.ERROR)
+   @Message(id = 214033, value = "Cannot resolve host ",
+           format = Message.Format.MESSAGE_FORMAT)
+   void unableToResolveHost(@Cause UnknownHostException e);
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
index 0ff971d..4b48caa 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
@@ -470,7 +470,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
{
       try {
          doCleanUp(false);
       } catch (ActiveMQException e) {
-         ActiveMQClientLogger.LOGGER.warn("problem cleaning up: " + this);
+         ActiveMQClientLogger.LOGGER.failedCleaningUp(this.toString());
       }
    }
 
@@ -1005,7 +1005,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
{
                         }
                      });
                   } catch (Exception e) {
-                     ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
+                     ActiveMQClientLogger.LOGGER.failedPerformPostActionsOnMessage(e);
                   }
 
                   onMessageThread = null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
index cc26b7d..e8ac8f8 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
@@ -474,7 +474,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal,
C
          return latchFinalTopology.await(timeout, unit);
       } catch (InterruptedException e) {
          Thread.currentThread().interrupt();
-         ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
+         ActiveMQClientLogger.LOGGER.unableToReceiveClusterTopology(e);
          return false;
       }
    }
@@ -506,7 +506,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal,
C
          // this is just a debug, since an interrupt is an expected event (in case of a shutdown)
          logger.debug(e1.getMessage(), e1);
       } catch (Throwable t) {
-         logger.warn(t.getMessage(), t);
+         ActiveMQClientLogger.LOGGER.unableToHandleConnectionFailure(t);
          //for anything else just close so clients are un blocked
          close();
          throw t;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java
index 282932d..07e26b0 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/cluster/DiscoveryGroup.java
@@ -255,9 +255,7 @@ public final class DiscoveryGroup implements ActiveMQComponent {
                   data = endpoint.receiveBroadcast();
                   if (data == null) {
                      if (started) {
-                        // This is totally unexpected, so I'm not even bothering on creating
-                        // a log entry for that
-                        ActiveMQClientLogger.LOGGER.warn("Unexpected null data received from
DiscoveryEndpoint");
+                        ActiveMQClientLogger.LOGGER.unexpectedNullDataReceived();
                      }
                      break;
                   }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
index e0837e9..28bd2f6 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/RemotingConnectionImpl.java
@@ -201,7 +201,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection
implement
       try {
          transportConnection.forceClose();
       } catch (Throwable e) {
-         ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
+         ActiveMQClientLogger.LOGGER.failedForceClose(e);
       }
 
       // Then call the listeners

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/Epoll.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/Epoll.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/Epoll.java
index 40612d4..8553d7f 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/Epoll.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/Epoll.java
@@ -17,15 +17,14 @@
 
 package org.apache.activemq.artemis.core.remoting.impl.netty;
 
+import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
 import org.apache.activemq.artemis.utils.Env;
-import org.jboss.logging.Logger;
 
 /**
  * Tells if <a href="http://netty.io/wiki/native-transports.html">{@code netty-transport-native-epoll}</a>
is supported.
  */
 public final class Epoll {
 
-   private static final Logger logger = Logger.getLogger(Epoll.class);
    private static final boolean IS_AVAILABLE_EPOLL = isIsAvailableEpoll();
 
    private static boolean isIsAvailableEpoll() {
@@ -36,7 +35,7 @@ public final class Epoll {
             return false;
          }
       } catch (Throwable e) {
-         logger.warn(e.getMessage(), e);
+         ActiveMQClientLogger.LOGGER.unableToCheckEpollAvailability(e);
          return false;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
index 384ca5e..10dc553 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnection.java
@@ -194,7 +194,7 @@ public class NettyConnection implements Connection {
                final ReadyListener readyListener = readyToCall.get(i);
                readyListener.readyForWriting();
             } catch (Throwable logOnly) {
-               ActiveMQClientLogger.LOGGER.warn(logOnly.getMessage(), logOnly);
+               ActiveMQClientLogger.LOGGER.failedToSetChannelReadyForWriting(logOnly);
             }
          }
       } finally {
@@ -208,7 +208,7 @@ public class NettyConnection implements Connection {
          try {
             channel.close();
          } catch (Throwable e) {
-            ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQClientLogger.LOGGER.failedForceClose(e);
          }
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
index 20431f0..1882490 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
@@ -1111,7 +1111,7 @@ public class NettyConnector extends AbstractConnector {
 
          result = ip1.equals(ip2);
       } catch (UnknownHostException e) {
-         ActiveMQClientLogger.LOGGER.error("Cannot resolve host", e);
+         ActiveMQClientLogger.LOGGER.unableToResolveHost(e);
       }
 
       return result;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bef3864c/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/VersionLoader.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/VersionLoader.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/VersionLoader.java
index 22d274d..39509a3 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/VersionLoader.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/VersionLoader.java
@@ -57,7 +57,7 @@ public final class VersionLoader {
                }
             });
          } catch (Throwable e) {
-            ActiveMQClientLogger.LOGGER.warn(e.getMessage(), e);
+            ActiveMQClientLogger.LOGGER.unableToInitVersionLoader(e);
             PROP_FILE_NAME = null;
          }
 
@@ -68,7 +68,7 @@ public final class VersionLoader {
          VersionLoader.versions = VersionLoader.load();
       } catch (Throwable e) {
          VersionLoader.versions = null;
-         ActiveMQClientLogger.LOGGER.error(e.getMessage(), e);
+         ActiveMQClientLogger.LOGGER.unableToInitVersionLoaderError(e);
       }
 
    }


Mime
View raw message