You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2022/05/12 15:41:19 UTC

[activemq-artemis] branch new-logging updated: restore a @Cause annotation to args that had it removed previously, where method still exists

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

robbie pushed a commit to branch new-logging
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/new-logging by this push:
     new 0b905b7535 restore a @Cause annotation to args that had it removed previously, where method still exists
0b905b7535 is described below

commit 0b905b75353991615d14fe62594ca6ecdcc48a51
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Thu May 12 16:30:08 2022 +0100

    restore a @Cause annotation to args that had it removed previously, where method still exists
---
 .../activemq/artemis/logs/ActiveMQUtilBundle.java  |   3 +-
 .../activemq/artemis/logs/ActiveMQUtilLogger.java  |  21 ++--
 .../apache/activemq/artemis/logs/AuditLogger.java  |   3 +-
 .../artemis/core/client/ActiveMQClientLogger.java  | 119 +++++++++++----------
 .../core/client/ActiveMQClientMessageBundle.java   |  21 ++--
 .../artemis/journal/ActiveMQJournalLogger.java     |  39 +++----
 .../artemis/core/server/ActiveMQMessageBundle.java |   9 +-
 7 files changed, 111 insertions(+), 104 deletions(-)

diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilBundle.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilBundle.java
index fdb429a492..bce2df7d1b 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilBundle.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilBundle.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.logs;
 
 import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException;
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
 import org.apache.activemq.artemis.logprocessor.annotation.Message;
 
@@ -43,7 +44,7 @@ public interface ActiveMQUtilBundle {
    IllegalStateException stringTooLong(Integer length);
 
    @Message(id = 209003, value = "Error instantiating codec {}")
-   IllegalArgumentException errorCreatingCodec(Exception e, String codecClassName);
+   IllegalArgumentException errorCreatingCodec(@Cause Exception e, String codecClassName);
 
    @Message(id = 209004, value = "Failed to parse long value from {}")
    IllegalArgumentException failedToParseLong(String value);
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilLogger.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilLogger.java
index a4e360e653..6a1d8e4193 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilLogger.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/ActiveMQUtilLogger.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.artemis.logs;
 
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
 import org.apache.activemq.artemis.logprocessor.annotation.LogMessage;
 
@@ -47,37 +48,37 @@ public interface ActiveMQUtilLogger {
    void urlWasntReacheable(String url);
 
    @LogMessage(id = 202004, value = "Error starting component {} ", level = LogMessage.Level.WARN)
-   void errorStartingComponent(Exception e, String component);
+   void errorStartingComponent(@Cause Exception e, String component);
 
    @LogMessage(id = 202005, value = "Error stopping component {} ", level = LogMessage.Level.WARN)
-   void errorStoppingComponent(Exception e, String component);
+   void errorStoppingComponent(@Cause Exception e, String component);
 
    @LogMessage(id = 202006, value = "Failed to check Url {}.", level = LogMessage.Level.WARN)
-   void failedToCheckURL(Exception e, String url);
+   void failedToCheckURL(@Cause Exception e, String url);
 
    @LogMessage(id = 202007, value = "Failed to check Address {}.", level = LogMessage.Level.WARN)
-   void failedToCheckAddress(Exception e, String address);
+   void failedToCheckAddress(@Cause Exception e, String address);
 
    @LogMessage(id = 202008, value = "Failed to check Address list {}.", level = LogMessage.Level.WARN)
-   void failedToParseAddressList(Exception e, String addressList);
+   void failedToParseAddressList(@Cause Exception e, String addressList);
 
    @LogMessage(id = 202009, value = "Failed to check Url list {}.", level = LogMessage.Level.WARN)
-   void failedToParseUrlList(Exception e, String urlList);
+   void failedToParseUrlList(@Cause Exception e, String urlList);
 
    @LogMessage(id = 202010, value = "Failed to set NIC {}.", level = LogMessage.Level.WARN)
-   void failedToSetNIC(Exception e, String nic);
+   void failedToSetNIC(@Cause Exception e, String nic);
 
    @LogMessage(id = 202011, value = "Failed to read from stream {}.", level = LogMessage.Level.WARN)
    void failedToReadFromStream(String stream);
 
    @LogMessage(id = 202012, value = "Object cannot be serialized.", level = LogMessage.Level.WARN)
-   void failedToSerializeObject(Exception e);
+   void failedToSerializeObject(@Cause Exception e);
 
    @LogMessage(id = 202013, value = "Unable to deserialize object.", level = LogMessage.Level.WARN)
-   void failedToDeserializeObject(Exception e);
+   void failedToDeserializeObject(@Cause Exception e);
 
    @LogMessage(id = 202014, value = "Unable to encode byte array into Base64 notation.", level = LogMessage.Level.WARN)
-   void failedToEncodeByteArrayToBase64Notation(Exception e);
+   void failedToEncodeByteArrayToBase64Notation(@Cause Exception e);
 
    @LogMessage(id = 202015, value = "Failed to clean up file {}", level = LogMessage.Level.WARN)
    void failedToCleanupFile(String file);
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
index 82421b10b6..8b146f602d 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.logs;
 
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.GetLogger;
 import org.apache.activemq.artemis.logprocessor.annotation.LogMessage;
 import org.slf4j.Logger;
@@ -1999,7 +2000,7 @@ public interface AuditLogger {
    }
 
    @LogMessage(id = 601264, value = "User {} gets security check failure", level = LogMessage.Level.INFO)
-   void securityFailure(String user, Throwable cause);
+   void securityFailure(String user, @Cause Throwable cause);
 
 
    static void createCoreConsumer(Object source, Subject user, String remoteAddress, Object... args) {
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 6c6d0cf248..e52801f096 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
@@ -22,6 +22,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.Interceptor;
 import org.apache.activemq.artemis.core.protocol.core.Packet;
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
 import org.apache.activemq.artemis.logprocessor.annotation.LogMessage;
 import org.w3c.dom.Node;
@@ -38,13 +39,13 @@ public interface ActiveMQClientLogger {
    ActiveMQClientLogger LOGGER = CodeFactory.getCodeClass(ActiveMQClientLogger.class);
 
    @LogMessage(id = 212001, value = "Error on clearing messages", level = LogMessage.Level.WARN)
-   void errorClearingMessages(Throwable e);
+   void errorClearingMessages(@Cause Throwable e);
 
    @LogMessage(id = 212002, value = "Timed out waiting for handler to complete processing", level = LogMessage.Level.WARN)
    void timeOutWaitingForProcessing();
 
    @LogMessage(id = 212003, value = "Unable to close session", level = LogMessage.Level.WARN)
-   void unableToCloseSession(Exception e);
+   void unableToCloseSession(@Cause Exception e);
 
    @LogMessage(id = 212004, value = "Failed to connect to server.", level = LogMessage.Level.WARN)
    void failedToConnectToServer();
@@ -53,10 +54,10 @@ public interface ActiveMQClientLogger {
    void failedToConnectToServer(Integer reconnectAttempts);
 
    @LogMessage(id = 212007, value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.", level = LogMessage.Level.WARN)
-   void createConnectorException(Exception e);
+   void createConnectorException(@Cause Exception e);
 
    @LogMessage(id = 212008, value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly " + "before letting them go out of scope! {0}", level = LogMessage.Level.WARN)
-   void factoryLeftOpen(Exception e, int i);
+   void factoryLeftOpen(@Cause Exception e, int i);
 
    @LogMessage(id = 212009, value = "resetting session after failure", level = LogMessage.Level.WARN)
    void resettingSessionAfterFailure();
@@ -74,37 +75,37 @@ public interface ActiveMQClientLogger {
    void failoverDuringPrepareRollingBack();
 
    @LogMessage(id = 212015, value = "failover occurred during prepare rolling back", level = LogMessage.Level.WARN)
-   void errorDuringPrepare(Throwable e);
+   void errorDuringPrepare(@Cause Throwable e);
 
    @LogMessage(id = 212016, value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {0}", level = LogMessage.Level.WARN)
-   void clientSessionNotClosed(Exception e, int identity);
+   void clientSessionNotClosed(@Cause Exception e, int identity);
 
    @LogMessage(id = 212017, value = "error adding packet", level = LogMessage.Level.WARN)
-   void errorAddingPacket(Exception e);
+   void errorAddingPacket(@Cause Exception e);
 
    @LogMessage(id = 212018, value = "error calling cancel", level = LogMessage.Level.WARN)
-   void errorCallingCancel(Exception e);
+   void errorCallingCancel(@Cause Exception e);
 
    @LogMessage(id = 212019, value = "error reading index", level = LogMessage.Level.WARN)
-   void errorReadingIndex(Exception e);
+   void errorReadingIndex(@Cause Exception e);
 
    @LogMessage(id = 212020, value = "error setting index", level = LogMessage.Level.WARN)
-   void errorSettingIndex(Exception e);
+   void errorSettingIndex(@Cause Exception e);
 
    @LogMessage(id = 212021, value = "error resetting index", level = LogMessage.Level.WARN)
-   void errorReSettingIndex(Exception e);
+   void errorReSettingIndex(@Cause Exception e);
 
    @LogMessage(id = 212022, value = "error reading LargeMessage file cache", level = LogMessage.Level.WARN)
-   void errorReadingCache(Exception e);
+   void errorReadingCache(@Cause Exception e);
 
    @LogMessage(id = 212023, value = "error closing LargeMessage file cache", level = LogMessage.Level.WARN)
-   void errorClosingCache(Exception e);
+   void errorClosingCache(@Cause Exception e);
 
    @LogMessage(id = 212024, value = "Exception during finalization for LargeMessage file cache", level = LogMessage.Level.WARN)
-   void errorFinalisingCache(Exception e);
+   void errorFinalisingCache(@Cause Exception e);
 
    @LogMessage(id = 212025, value = "did not connect the cluster connection to other nodes", level = LogMessage.Level.WARN)
-   void errorConnectingToNodes(Exception e);
+   void errorConnectingToNodes(@Cause Exception e);
 
    @LogMessage(id = 212026, value = "Timed out waiting for pool to terminate", level = LogMessage.Level.WARN)
    void timedOutWaitingForTermination();
@@ -113,26 +114,26 @@ public interface ActiveMQClientLogger {
    void timedOutWaitingForScheduledPoolTermination();
 
    @LogMessage(id = 212028, value = "error starting server locator", level = LogMessage.Level.WARN)
-   void errorStartingLocator(Exception e);
+   void errorStartingLocator(@Cause Exception e);
 
 
    @LogMessage(id = 212030, value = "error sending topology", level = LogMessage.Level.WARN)
-   void errorSendingTopology(Throwable e);
+   void errorSendingTopology(@Cause Throwable e);
 
    @LogMessage(id = 212031, value = "error sending topology", level = LogMessage.Level.WARN)
-   void errorSendingTopologyNodedown(Throwable e);
+   void errorSendingTopologyNodedown(@Cause Throwable e);
 
    @LogMessage(id = 212032, value = "Timed out waiting to stop discovery thread", level = LogMessage.Level.WARN)
    void timedOutStoppingDiscovery();
 
    @LogMessage(id = 212033, value = "unable to send notification when discovery group is stopped", level = LogMessage.Level.WARN)
-   void errorSendingNotifOnDiscoveryStop(Throwable e);
+   void errorSendingNotifOnDiscoveryStop(@Cause Throwable e);
 
    @LogMessage(id = 212034, value = "There are more than one servers on the network broadcasting the same node id. " + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely " + "ignored. But if it is logged continuously it means you really do have more than one node on the same network " + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as " + "its live node. nodeID={0}", le [...]
    void multipleServersBroadcastingSameNode(String nodeId);
 
    @LogMessage(id = 212035, value = "error receiving packet in discovery", level = LogMessage.Level.WARN)
-   void errorReceivingPacketInDiscovery(Throwable e);
+   void errorReceivingPacketInDiscovery(@Cause Throwable e);
 
    @LogMessage(id = 212036, value = "Can not find packet to clear: {0} last received command id first stored command id {1}", level = LogMessage.Level.WARN)
    void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer firstStoredCommandID);
@@ -141,7 +142,7 @@ public interface ActiveMQClientLogger {
    void connectionFailureDetected(String remoteAddress, String message, ActiveMQExceptionType type);
 
    @LogMessage(id = 212038, value = "Failure in calling interceptor: {0}", level = LogMessage.Level.WARN)
-   void errorCallingInterceptor(Throwable e, Interceptor interceptor);
+   void errorCallingInterceptor(@Cause Throwable e, Interceptor interceptor);
 
    @LogMessage(id = 212040, value = "Timed out waiting for netty ssl close future to complete", level = LogMessage.Level.WARN)
    void timeoutClosingSSL();
@@ -168,7 +169,7 @@ public interface ActiveMQClientLogger {
    void jvmAllocatedMoreMemory(Long totalMemory1, Long totalMemory2);
 
    @LogMessage(id = 212048, value = "Random address ({0}) was already in use, trying another time", level = LogMessage.Level.WARN)
-   void broadcastGroupBindErrorRetry(String hostAndPort, Throwable t);
+   void broadcastGroupBindErrorRetry(String hostAndPort, @Cause Throwable t);
 
    @LogMessage(id = 212049, value = "Could not bind to {0} ({1} address); " + "make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." + "\nIgnoring discovery group-address, but this may lead to cross talking.", level = LogMessage.Level.WARN)
    void ioDiscoveryError(String hostAddress, String s);
@@ -177,10 +178,10 @@ public interface ActiveMQClientLogger {
    void compressedLargeMessageError(int length, int nReadBytes);
 
    @LogMessage(id = 212051, value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.", level = LogMessage.Level.WARN)
-   void invalidConcurrentSessionUsage(Throwable t);
+   void invalidConcurrentSessionUsage(@Cause Throwable t);
 
    @LogMessage(id = 212052, value = "Packet {0} was answered out of sequence due to a previous server timeout and it''s being ignored", level = LogMessage.Level.WARN)
-   void packetOutOfOrder(Object obj, Throwable t);
+   void packetOutOfOrder(Object obj, @Cause Throwable t);
 
    /**
     * Warns about usage of {@link org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with
@@ -194,7 +195,7 @@ public interface ActiveMQClientLogger {
    void outOfCreditOnFlowControl(String address);
 
    @LogMessage(id = 212055, value = "Unable to close consumer", level = LogMessage.Level.WARN)
-   void unableToCloseConsumer(Exception e);
+   void unableToCloseConsumer(@Cause Exception e);
 
    @LogMessage(id = 212056, value = "local-bind-address specified for broadcast group but no local-bind-port. Using random port for UDP Broadcast ({0})", level = LogMessage.Level.WARN)
    void broadcastGroupBindError(String hostAndPort);
@@ -203,7 +204,7 @@ public interface ActiveMQClientLogger {
    void timeoutStreamingLargeMessage();
 
    @LogMessage(id = 212058, value = "Unable to get a message.", level = LogMessage.Level.WARN)
-   void unableToGetMessage(Exception e);
+   void unableToGetMessage(@Cause Exception e);
 
    @LogMessage(id = 212059, value = "Failed to clean up: {0} ", level = LogMessage.Level.WARN)
    void failedCleaningUp(String target);
@@ -212,25 +213,25 @@ public interface ActiveMQClientLogger {
    void unexpectedNullDataReceived();
 
    @LogMessage(id = 212061, value = "Failed to perform force close ", level = LogMessage.Level.WARN)
-   void failedForceClose(Throwable e);
+   void failedForceClose(@Cause Throwable e);
 
    @LogMessage(id = 212062, value = "Failed to perform post actions on message processing ", level = LogMessage.Level.WARN)
-   void failedPerformPostActionsOnMessage(Exception e);
+   void failedPerformPostActionsOnMessage(@Cause Exception e);
 
    @LogMessage(id = 212063, value = "Unable to handle connection failure ", level = LogMessage.Level.WARN)
-   void unableToHandleConnectionFailure(Throwable e);
+   void unableToHandleConnectionFailure(@Cause Throwable e);
 
    @LogMessage(id = 212064, value = "Unable to receive cluster topology ", level = LogMessage.Level.WARN)
-   void unableToReceiveClusterTopology(Throwable e);
+   void unableToReceiveClusterTopology(@Cause Throwable e);
 
    @LogMessage(id = 212065, value = "{0} getting exception when receiving broadcasting ", level = LogMessage.Level.WARN)
-   void unableToReceiveBroadcast(Exception e, String target);
+   void unableToReceiveBroadcast(@Cause Exception e, String target);
 
    @LogMessage(id = 212066, value = "failed to parse int property ", level = LogMessage.Level.WARN)
-   void unableToParseValue(Throwable e);
+   void unableToParseValue(@Cause Throwable e);
 
    @LogMessage(id = 212067, value = "failed to get system property ", level = LogMessage.Level.WARN)
-   void unableToGetProperty(Throwable e);
+   void unableToGetProperty(@Cause Throwable e);
 
    @LogMessage(id = 212068, value = "Couldn't finish the client globalThreadPool in less than 10 seconds, interrupting it now ", level = LogMessage.Level.WARN)
    void unableToProcessGlobalThreadPoolIn10Sec();
@@ -239,16 +240,16 @@ public interface ActiveMQClientLogger {
    void unableToProcessScheduledlIn10Sec();
 
    @LogMessage(id = 212070, value = "Unable to initialize VersionLoader ", level = LogMessage.Level.WARN)
-   void unableToInitVersionLoader(Throwable e);
+   void unableToInitVersionLoader(@Cause Throwable e);
 
    @LogMessage(id = 212071, value = "Unable to check Epoll availability ", level = LogMessage.Level.WARN)
-   void unableToCheckEpollAvailability(Throwable e);
+   void unableToCheckEpollAvailability(@Cause Throwable e);
 
    @LogMessage(id = 212072, value = "Failed to change channel state to ReadyForWriting ", level = LogMessage.Level.WARN)
-   void failedToSetChannelReadyForWriting(Throwable e);
+   void failedToSetChannelReadyForWriting(@Cause Throwable e);
 
    @LogMessage(id = 212073, value = "Unable to check KQueue availability ", level = LogMessage.Level.WARN)
-   void unableToCheckKQueueAvailability(Throwable e);
+   void unableToCheckKQueueAvailability(@Cause Throwable e);
 
    @LogMessage(id = 212075, value = "KQueue is not available, please add to the classpath or configure useKQueue=false to remove this warning", level = LogMessage.Level.WARN)
    void unableToCheckKQueueAvailabilityNoClass();
@@ -266,19 +267,19 @@ public interface ActiveMQClientLogger {
    void oldStoreProvider(String value);
 
    @LogMessage(id = 214000, value = "Failed to call onMessage", level = LogMessage.Level.ERROR)
-   void onMessageError(Throwable e);
+   void onMessageError(@Cause Throwable e);
 
    @LogMessage(id = 214001, value = "failed to cleanup session", level = LogMessage.Level.ERROR)
-   void failedToCleanupSession(Exception e);
+   void failedToCleanupSession(@Cause Exception e);
 
    @LogMessage(id = 214002, value = "Failed to execute failure listener", level = LogMessage.Level.ERROR)
-   void failedToExecuteListener(Throwable t);
+   void failedToExecuteListener(@Cause Throwable t);
 
    @LogMessage(id = 214003, value = "Failed to handle failover", level = LogMessage.Level.ERROR)
-   void failedToHandleFailover(Throwable t);
+   void failedToHandleFailover(@Cause Throwable t);
 
    @LogMessage(id = 214004, value = "XA end operation failed ", level = LogMessage.Level.ERROR)
-   void errorCallingEnd(Throwable t);
+   void errorCallingEnd(@Cause Throwable t);
 
    @LogMessage(id = 214005, value = "XA start operation failed {0} code:{1}", level = LogMessage.Level.ERROR)
    void errorCallingStart(String message, Integer code);
@@ -287,43 +288,43 @@ public interface ActiveMQClientLogger {
    void sessionNotXA();
 
    @LogMessage(id = 214007, value = "Received exception asynchronously from server", level = LogMessage.Level.ERROR)
-   void receivedExceptionAsynchronously(Exception e);
+   void receivedExceptionAsynchronously(@Cause Exception e);
 
    @LogMessage(id = 214008, value = "Failed to handle packet", level = LogMessage.Level.ERROR)
-   void failedToHandlePacket(Exception e);
+   void failedToHandlePacket(@Cause Exception e);
 
    @LogMessage(id = 214009, value = "Failed to stop discovery group", level = LogMessage.Level.ERROR)
-   void failedToStopDiscovery(Throwable e);
+   void failedToStopDiscovery(@Cause Throwable e);
 
    @LogMessage(id = 214010, value = "Failed to receive datagram", level = LogMessage.Level.ERROR)
-   void failedToReceiveDatagramInDiscovery(Throwable e);
+   void failedToReceiveDatagramInDiscovery(@Cause Throwable e);
 
    @LogMessage(id = 214011, value = "Failed to call discovery listener", level = LogMessage.Level.ERROR)
-   void failedToCallListenerInDiscovery(Throwable e);
+   void failedToCallListenerInDiscovery(@Cause Throwable e);
 
    @LogMessage(id = 214013, value = "Failed to decode packet", level = LogMessage.Level.ERROR)
-   void errorDecodingPacket(Throwable e);
+   void errorDecodingPacket(@Cause Throwable e);
 
    @LogMessage(id = 214014, value = "Failed to execute failure listener", level = LogMessage.Level.ERROR)
-   void errorCallingFailureListener(Throwable e);
+   void errorCallingFailureListener(@Cause Throwable e);
 
    @LogMessage(id = 214015, value = "Failed to execute connection life cycle listener", level = LogMessage.Level.ERROR)
-   void errorCallingLifeCycleListener(Throwable e);
+   void errorCallingLifeCycleListener(@Cause Throwable e);
 
    @LogMessage(id = 214016, value = "Failed to create netty connection", level = LogMessage.Level.ERROR)
-   void errorCreatingNettyConnection(Throwable e);
+   void errorCreatingNettyConnection(@Cause Throwable e);
 
    @LogMessage(id = 214017, value = "Caught unexpected Throwable", level = LogMessage.Level.ERROR)
-   void caughtunexpectedThrowable(Throwable t);
+   void caughtunexpectedThrowable(@Cause Throwable t);
 
    @LogMessage(id = 214018, value = "Failed to invoke getTextContent() on node {0}", level = LogMessage.Level.ERROR)
-   void errorOnXMLTransform(Throwable t, Node n);
+   void errorOnXMLTransform(@Cause Throwable t, Node n);
 
    @LogMessage(id = 214019, value = "Invalid configuration", level = LogMessage.Level.ERROR)
-   void errorOnXMLTransformInvalidConf(Throwable t);
+   void errorOnXMLTransformInvalidConf(@Cause Throwable t);
 
    @LogMessage(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {0}", level = LogMessage.Level.ERROR)
-   void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, Throwable t);
+   void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, @Cause Throwable t);
 
    @LogMessage(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", level = LogMessage.Level.ERROR)
    void invalidCipherSuite(String validSuites);
@@ -338,14 +339,14 @@ public interface ActiveMQClientLogger {
    void unexpectedResponseFromHttpServer(Object response);
 
    @LogMessage(id = 214030, value = "Failed to bind {0}={1}", level = LogMessage.Level.ERROR)
-   void failedToBind(String p1, String p2, Throwable cause);
+   void failedToBind(String p1, String p2, @Cause Throwable cause);
 
    @LogMessage(id = 214031, value = "Failed to decode buffer, disconnect immediately.", level = LogMessage.Level.ERROR)
-   void disconnectOnErrorDecoding(Throwable cause);
+   void disconnectOnErrorDecoding(@Cause Throwable cause);
 
    @LogMessage(id = 214032, value = "Unable to initialize VersionLoader ", level = LogMessage.Level.ERROR)
-   void unableToInitVersionLoaderError(Throwable e);
+   void unableToInitVersionLoaderError(@Cause Throwable e);
 
    @LogMessage(id = 214033, value = "Cannot resolve host ", level = LogMessage.Level.ERROR)
-   void unableToResolveHost(UnknownHostException e);
+   void unableToResolveHost(@Cause UnknownHostException e);
 }
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientMessageBundle.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientMessageBundle.java
index 6facf87205..219c184de4 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientMessageBundle.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientMessageBundle.java
@@ -33,6 +33,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQTransactionRolledBackExcepti
 import org.apache.activemq.artemis.api.core.ActiveMQUnBlockedException;
 import org.apache.activemq.artemis.core.cluster.DiscoveryGroup;
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
 import org.apache.activemq.artemis.logprocessor.annotation.Message;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
@@ -54,13 +55,13 @@ public interface ActiveMQClientMessageBundle {
    ActiveMQInternalErrorException clientSessionClosed();
 
    @Message(id = 219001, value = "Failed to create session")
-   ActiveMQInternalErrorException failedToCreateSession(Throwable t);
+   ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t);
 
    @Message(id = 219003, value = "Queue can not be both durable and temporary")
    ActiveMQInternalErrorException queueMisConfigured();
 
    @Message(id = 219004, value = "Failed to initialise session factory")
-   ActiveMQInternalErrorException failedToInitialiseSessionFactory(Exception e);
+   ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
 
    @Message(id = 219005, value = "Exception in Netty transport")
    ActiveMQInternalErrorException nettyError();
@@ -72,7 +73,7 @@ public interface ActiveMQClientMessageBundle {
    ActiveMQNotConnectedException cannotConnectToServers();
 
    @Message(id = 219008, value = "Failed to connect to any static connectors")
-   ActiveMQNotConnectedException cannotConnectToStaticConnectors(Exception e);
+   ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
 
    @Message(id = 219009, value = "Failed to connect to any static connectors")
    ActiveMQNotConnectedException cannotConnectToStaticConnectors2();
@@ -96,7 +97,7 @@ public interface ActiveMQClientMessageBundle {
    ActiveMQDisconnectedException disconnected();
 
    @Message(id = 219016, value = "Connection failure detected. Unblocking a blocking call that will never get a response")
-   ActiveMQUnBlockedException unblockingACall(Throwable t);
+   ActiveMQUnBlockedException unblockingACall(@Cause Throwable t);
 
    @Message(id = 219017, value = "Consumer is closed")
    ActiveMQObjectClosedException consumerClosed();
@@ -123,19 +124,19 @@ public interface ActiveMQClientMessageBundle {
    ActiveMQIllegalStateException noTCForSessionFactory();
 
    @Message(id = 219025, value = "Error saving the message body")
-   ActiveMQLargeMessageException errorSavingBody(Exception e);
+   ActiveMQLargeMessageException errorSavingBody(@Cause Exception e);
 
    @Message(id = 219026, value = "Error reading the LargeMessageBody")
-   ActiveMQLargeMessageException errorReadingBody(Exception e);
+   ActiveMQLargeMessageException errorReadingBody(@Cause Exception e);
 
    @Message(id = 219027, value = "Error closing stream from LargeMessageBody")
-   ActiveMQLargeMessageException errorClosingLargeMessage(Exception e);
+   ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
 
    @Message(id = 219028, value = "Timeout waiting for LargeMessage Body")
    ActiveMQLargeMessageException timeoutOnLargeMessage();
 
    @Message(id = 219029, value = "Error writing body of message")
-   ActiveMQLargeMessageException errorWritingLargeMessage(Exception e);
+   ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
 
    @Message(id = 219030, value = "The transaction was rolled back on failover to a backup server")
    ActiveMQTransactionRolledBackException txRolledBack();
@@ -210,7 +211,7 @@ public interface ActiveMQClientMessageBundle {
    IllegalArgumentException mustBeLong(Node element, String value);
 
    @Message(id = 219057, value = "Error decoding password")
-   IllegalArgumentException errordecodingPassword(Exception e);
+   IllegalArgumentException errordecodingPassword(@Cause Exception e);
 
    @Message(id = 219058, value = "Address \"{0}\" is full. Message encode size = {1}B")
    ActiveMQAddressFullException addressIsFull(String addressName, int size);
@@ -234,7 +235,7 @@ public interface ActiveMQClientMessageBundle {
    IllegalStateException invalidPacket(byte type);
 
    @Message(id = 219065, value = "Failed to handle packet.")
-   RuntimeException failedToHandlePacket(Exception e);
+   RuntimeException failedToHandlePacket(@Cause Exception e);
 
    @Message(id = 219066, value = "The connection was redirected")
    ActiveMQRoutingException redirected();
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java
index 8c578f866b..0e8cfceea8 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java
@@ -18,6 +18,7 @@ package org.apache.activemq.artemis.journal;
 
 import org.apache.activemq.artemis.core.journal.impl.JournalFile;
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
 import org.apache.activemq.artemis.logprocessor.annotation.LogMessage;
 
@@ -129,43 +130,43 @@ public interface ActiveMQJournalLogger {
    void errorOnIOCallback(String errorMessage);
 
    @LogMessage(id = 142022, value = "Timed out on AIO poller shutdown", level = LogMessage.Level.WARN)
-   void timeoutOnPollerShutdown(Exception e);
+   void timeoutOnPollerShutdown(@Cause Exception e);
 
    @LogMessage(id = 142023, value = "Executor on file {} couldn''t complete its tasks in 60 seconds.", level = LogMessage.Level.WARN)
-   void couldNotCompleteTask(Exception e, String name);
+   void couldNotCompleteTask(@Cause Exception e, String name);
 
    @LogMessage(id = 142024, value = "Error completing callback", level = LogMessage.Level.WARN)
-   void errorCompletingCallback(Throwable e);
+   void errorCompletingCallback(@Cause Throwable e);
 
    @LogMessage(id = 142025, value = "Error calling onError callback", level = LogMessage.Level.WARN)
-   void errorCallingErrorCallback(Throwable e);
+   void errorCallingErrorCallback(@Cause Throwable e);
 
    @LogMessage(id = 142026, value = "Timed out on AIO writer shutdown", level = LogMessage.Level.WARN)
-   void timeoutOnWriterShutdown(Throwable e);
+   void timeoutOnWriterShutdown(@Cause Throwable e);
 
    @LogMessage(id = 142027, value = "Error on writing data! {} code - {}", level = LogMessage.Level.WARN)
-   void errorWritingData(Throwable e, String errorMessage, Integer errorCode);
+   void errorWritingData(@Cause Throwable e, String errorMessage, Integer errorCode);
 
    @LogMessage(id = 142028, value = "Error replaying pending commands after compacting", level = LogMessage.Level.WARN)
-   void errorReplayingCommands(Throwable e);
+   void errorReplayingCommands(@Cause Throwable e);
 
    @LogMessage(id = 142029, value = "Error closing file", level = LogMessage.Level.WARN)
-   void errorClosingFile(Throwable e);
+   void errorClosingFile(@Cause Throwable e);
 
    @LogMessage(id = 142030, value = "Could not open a file in 60 Seconds", level = LogMessage.Level.WARN)
-   void errorOpeningFile(Throwable e);
+   void errorOpeningFile(@Cause Throwable e);
 
    @LogMessage(id = 142031, value = "Error retrieving ID part of the file name {}", level = LogMessage.Level.WARN)
-   void errorRetrievingID(Throwable e, String fileName);
+   void errorRetrievingID(@Cause Throwable e, String fileName);
 
    @LogMessage(id = 142032, value = "Error reading journal file", level = LogMessage.Level.WARN)
-   void errorReadingFile(Throwable e);
+   void errorReadingFile(@Cause Throwable e);
 
    @LogMessage(id = 142033, value = "Error reinitializing file {}", level = LogMessage.Level.WARN)
-   void errorReinitializingFile(Throwable e, JournalFile file);
+   void errorReinitializingFile(@Cause Throwable e, JournalFile file);
 
    @LogMessage(id = 142034, value = "Exception on submitting write", level = LogMessage.Level.WARN)
-   void errorSubmittingWrite(Throwable e);
+   void errorSubmittingWrite(@Cause Throwable e);
 
    @LogMessage(id = 142035, value = "Could not stop journal append executor after 60 seconds", level = LogMessage.Level.WARN)
    void couldNotStopJournalAppendExecutor();
@@ -174,19 +175,19 @@ public interface ActiveMQJournalLogger {
    void errorDeletingFile(Object e);
 
    @LogMessage(id = 144001, value = "Error starting poller", level = LogMessage.Level.ERROR)
-   void errorStartingPoller(Exception e);
+   void errorStartingPoller(@Cause Exception e);
 
    @LogMessage(id = 144002, value = "Error pushing opened file", level = LogMessage.Level.ERROR)
-   void errorPushingFile(Exception e);
+   void errorPushingFile(@Cause Exception e);
 
    @LogMessage(id = 144003, value = "Error compacting", level = LogMessage.Level.ERROR)
-   void errorCompacting(Throwable e);
+   void errorCompacting(@Cause Throwable e);
 
    @LogMessage(id = 144004, value = "Error scheduling compacting", level = LogMessage.Level.ERROR)
-   void errorSchedulingCompacting(Throwable e);
+   void errorSchedulingCompacting(@Cause Throwable e);
 
    @LogMessage(id = 144005, value = "Failed to performance blast", level = LogMessage.Level.ERROR)
-   void failedToPerfBlast(Throwable e);
+   void failedToPerfBlast(@Cause Throwable e);
 
    @LogMessage(id = 144006, value = "IOError code {}, {}", level = LogMessage.Level.ERROR)
    void ioError(int errorCode, String errorMessage);
@@ -201,6 +202,6 @@ public interface ActiveMQJournalLogger {
    void cantOpenFileTimeout(long timeout);
 
    @LogMessage(id = 144010, value = "Critical IO Exception happened: {}", level = LogMessage.Level.WARN)
-   void criticalIO(String message, Exception error);
+   void criticalIO(String message, @Cause Exception error);
 
 }
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
index a8c611dd16..a5a8804fca 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java
@@ -54,6 +54,7 @@ import org.apache.activemq.artemis.core.postoffice.Binding;
 import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ReplicationSyncFileMessage;
 import org.apache.activemq.artemis.core.security.CheckType;
 import org.apache.activemq.artemis.logprocessor.CodeFactory;
+import org.apache.activemq.artemis.logprocessor.annotation.Cause;
 import org.apache.activemq.artemis.logprocessor.annotation.LogBundle;
 import org.apache.activemq.artemis.logprocessor.annotation.Message;
 
@@ -93,7 +94,7 @@ public interface ActiveMQMessageBundle {
    ActiveMQInternalErrorException notJournalImpl();
 
    @Message(id = 229007, value = "unhandled error during replication")
-   ActiveMQInternalErrorException replicationUnhandledError(Exception e);
+   ActiveMQInternalErrorException replicationUnhandledError(@Cause Exception e);
 
    @Message(id = 229008, value = "Live Node contains more journals than the backup node. Probably a version match error")
    ActiveMQInternalErrorException replicationTooManyJournals();
@@ -129,7 +130,7 @@ public interface ActiveMQMessageBundle {
    ActiveMQQueueExistsException queueAlreadyExists(SimpleString queueName, SimpleString addressName);
 
    @Message(id = 229020, value = "Invalid filter: {}")
-   ActiveMQInvalidFilterExpressionException invalidFilter(Throwable e, SimpleString filter);
+   ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
 
    @Message(id = 229021, value = "MessageId was not assigned to Message")
    ActiveMQIllegalStateException messageIdNotAssigned();
@@ -285,7 +286,7 @@ public interface ActiveMQMessageBundle {
    IllegalArgumentException nullPassword();
 
    @Message(id = 229074, value = "Error instantiating transformer class {}")
-   IllegalArgumentException errorCreatingTransformerClass(Exception e, String transformerClassName);
+   IllegalArgumentException errorCreatingTransformerClass(@Cause Exception e, String transformerClassName);
 
    @Message(id = 229075, value = "method autoEncode doesn''t know how to convert {} yet")
    IllegalArgumentException autoConvertError(Class<? extends Object> aClass);
@@ -486,7 +487,7 @@ public interface ActiveMQMessageBundle {
    IllegalArgumentException failedToParseJson(String json);
 
    @Message(id = 229230, value = "Failed to bind acceptor {} to {}")
-   IllegalStateException failedToBind(String acceptor, String hostPort, Exception e);
+   IllegalStateException failedToBind(String acceptor, String hostPort, @Cause Exception e);
 
    @Message(id = 229231, value = "Divert Does Not Exist: {}")
    ActiveMQDivertDoesNotExistException divertDoesNotExist(String divert);