[ARTEMIS-1251] Log messages without prefixed id code in artemis-jms-server

This commit is contained in:
Dmitrii Tikhomirov 2017-06-26 15:07:16 +02:00 committed by Clebert Suconic
parent 1888e2ca4f
commit 027faa36d1
4 changed files with 12 additions and 5 deletions

View File

@ -95,6 +95,10 @@ public interface ActiveMQJMSBridgeLogger extends BasicLogger {
@Message(id = 342010, value = "Failed to connect JMS Bridge {0}", format = Message.Format.MESSAGE_FORMAT)
void bridgeConnectError(@Cause Exception e, String bridgeName);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 342011, value = "Transaction rolled back, retrying TX", format = Message.Format.MESSAGE_FORMAT)
void transactionRolledBack(@Cause Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 344001, value = "JMS Bridge {0}, failed to start source connection", format = Message.Format.MESSAGE_FORMAT)
void jmsBridgeSrcConnectError(@Cause Exception e, String bridgeName);

View File

@ -1311,7 +1311,7 @@ public final class JMSBridgeImpl implements JMSBridge {
try {
sendMessages();
} catch (TransactionRolledbackException e) {
ActiveMQJMSBridgeLogger.LOGGER.warn(e.getMessage() + ", retrying TX", e);
ActiveMQJMSBridgeLogger.LOGGER.transactionRolledBack(e);
exHappened = true;
}
}

View File

@ -97,6 +97,12 @@ public interface ActiveMQJMSServerLogger extends BasicLogger {
format = Message.Format.MESSAGE_FORMAT)
void failedToSendNotification(String notification);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 122019,
value = "Unable to deactivate server",
format = Message.Format.MESSAGE_FORMAT)
void failedToDeactivateServer(@Cause Exception e);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 123000, value = "JMS Server Manager Running cached command for {0}." + "(In the event of failover after failback has occurred, this message may be output multiple times.)",
format = Message.Format.MESSAGE_FORMAT)

View File

@ -95,7 +95,6 @@ import org.apache.activemq.artemis.utils.SelectorTranslator;
import org.apache.activemq.artemis.utils.TimeAndCounterIDGenerator;
import org.apache.activemq.artemis.utils.XMLUtil;
import org.apache.activemq.artemis.utils.collections.TypedProperties;
import org.jboss.logging.Logger;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@ -147,8 +146,6 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
private final Map<String, List<String>> unRecoveredBindings = new HashMap<>();
private static final Logger logger = Logger.getLogger(JMSServerManagerImpl.class);
public JMSServerManagerImpl(final ActiveMQServer server) throws Exception {
this.server = server;
@ -250,7 +247,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
active = false;
}
} catch (Exception e) {
logger.warn("Unable to deactivate server", e.getMessage(), e);
ActiveMQJMSServerLogger.LOGGER.failedToDeactivateServer(e);
}
}