This commit is contained in:
Justin Bertram 2017-06-12 13:02:14 -05:00
commit 50c4039a49
3 changed files with 10 additions and 2 deletions

View File

@ -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) @Message(id = 182001, value = "shutdown REST subscription because of timeout for: {0}", format = Message.Format.MESSAGE_FORMAT)
void shutdownRestSubscription(String id); 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) @LogMessage(level = Logger.Level.ERROR)
@Message(id = 184000, value = "Failed to load push store {0}, it is probably corrupted", format = Message.Format.MESSAGE_FORMAT) @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); void errorLoadingStore(@Cause Exception e, String name);

View File

@ -175,7 +175,7 @@ public class UriStrategy implements PushStrategy {
} }
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQRestLogger.LOGGER.warn("failed to push message to " + uri, e); ActiveMQRestLogger.LOGGER.failedToPushMessageToUri(uri, e);
return false; return false;
} finally { } finally {
if (res != null) if (res != null)

View File

@ -83,7 +83,7 @@ public class HttpMessageHelper {
ActiveMQRestLogger.LOGGER.debug("**** Building Message from object: " + obj.toString()); ActiveMQRestLogger.LOGGER.debug("**** Building Message from object: " + obj.toString());
request.body(contentType, obj); request.body(contentType, obj);
} catch (Exception e) { } catch (Exception e) {
ActiveMQRestLogger.LOGGER.warn("Building Message from object", e.getMessage(), e); ActiveMQRestLogger.LOGGER.failedToBuildMessageFromObject(e);
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }