[ARTEMIS-1226] Log messages without prefixed id code in artemis-jms-client

This commit is contained in:
Dmitrii Tikhomirov 2017-06-12 13:24:57 +02:00 committed by Justin Bertram
parent 90edd572f0
commit 6ddeb96a8a
3 changed files with 11 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);
}
}
}