This commit is contained in:
Clebert Suconic 2017-09-28 21:41:40 -04:00
commit af6e3562a8
36 changed files with 328 additions and 76 deletions

View File

@ -918,7 +918,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
@Override @Override
@Deprecated @Deprecated
public ConfigurationImpl setWildcardRoutingEnabled(final boolean enabled) { public ConfigurationImpl setWildcardRoutingEnabled(final boolean enabled) {
logger.info("Usage of wildcardRoutingEnabled configuration property is deprecated, please use wildCardConfiguration.routingEnabled instead"); ActiveMQServerLogger.LOGGER.deprecatedWildcardRoutingEnabled();
wildcardConfiguration.setRoutingEnabled(enabled); wildcardConfiguration.setRoutingEnabled(enabled);
return this; return this;
} }
@ -1513,8 +1513,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
TransportConfiguration connector = getConnectorConfigurations().get(connectorName); TransportConfiguration connector = getConnectorConfigurations().get(connectorName);
if (connector == null) { if (connector == null) {
ActiveMQServerLogger.LOGGER.warn("bridgeNoConnector(connectorName)"); ActiveMQServerLogger.LOGGER.connectionConfigurationIsNull(connectorName == null ? "null" : connectorName);
return null; return null;
} }

View File

@ -118,7 +118,7 @@ public class PagedReferenceImpl implements PagedReference {
try { try {
messageEstimate = getMessage().getMemoryEstimate(); messageEstimate = getMessage().getMemoryEstimate();
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.errorCalculateMessageMemoryEstimate(e);
} }
} }
return messageEstimate; return messageEstimate;
@ -136,7 +136,7 @@ public class PagedReferenceImpl implements PagedReference {
Message msg = getMessage(); Message msg = getMessage();
return msg.getScheduledDeliveryTime(); return msg.getScheduledDeliveryTime();
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.errorCalculateScheduledDeliveryTime(e);
return 0L; return 0L;
} }
} }

View File

@ -313,14 +313,14 @@ public class PageCursorProviderImpl implements PageCursorProvider {
try { try {
sub.onPageModeCleared(tx); sub.onPageModeCleared(tx);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn("Error while cleaning paging on queue " + sub.getQueue().getName(), e); ActiveMQServerLogger.LOGGER.errorCleaningPagingOnQueue(e, sub.getQueue().getName().toString());
} }
} }
try { try {
tx.commit(); tx.commit();
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn("Error while cleaning page, during the commit", e); ActiveMQServerLogger.LOGGER.errorCleaningPagingDuringCommit(e);
} }
} }

View File

@ -725,7 +725,7 @@ final class PageSubscriptionImpl implements PageSubscription {
try { try {
store.deletePageComplete(completeInfo.getRecordID()); store.deletePageComplete(completeInfo.getRecordID());
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn("Error while deleting page-complete-record", e); ActiveMQServerLogger.LOGGER.errorDeletingPageCompleteRecord(e);
} }
info.setCompleteInfo(null); info.setCompleteInfo(null);
} }
@ -734,7 +734,7 @@ final class PageSubscriptionImpl implements PageSubscription {
try { try {
store.deleteCursorAcknowledge(deleteInfo.getRecordID()); store.deleteCursorAcknowledge(deleteInfo.getRecordID());
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn("Error while deleting page-complete-record", e); ActiveMQServerLogger.LOGGER.errorDeletingPageCompleteRecord(e);
} }
} }
} }

View File

@ -1437,12 +1437,12 @@ public abstract class AbstractJournalStorageManager extends CriticalComponentImp
queueBindingEncoding.addQueueStatusEncoding(statusEncoding); queueBindingEncoding.addQueueStatusEncoding(statusEncoding);
} else { } else {
// unlikely to happen, so I didn't bother about the Logger method // unlikely to happen, so I didn't bother about the Logger method
logger.info("There is no queue with ID " + statusEncoding.queueID + ", deleting record " + statusEncoding.getId()); ActiveMQServerLogger.LOGGER.infoNoQueueWithID(statusEncoding.queueID, statusEncoding.getId());
this.deleteQueueStatus(statusEncoding.getId()); this.deleteQueueStatus(statusEncoding.getId());
} }
} else { } else {
// unlikely to happen // unlikely to happen
logger.warn("Invalid record type " + rec, new Exception("invalid record type " + rec)); ActiveMQServerLogger.LOGGER.invalidRecordType(rec, new Exception("invalid record type " + rec));
} }
} }

View File

@ -604,7 +604,7 @@ public class JournalStorageManager extends AbstractJournalStorageManager {
storageManagerLock.writeLock().unlock(); storageManagerLock.writeLock().unlock();
} }
} catch (Exception e) { } catch (Exception e) {
logger.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToStartReplication(e);
stopReplication(); stopReplication();
throw e; throw e;
} finally { } finally {

View File

@ -439,7 +439,7 @@ public final class LargeServerMessageImpl extends CoreMessage implements LargeSe
try { try {
bodySize = file.size(); bodySize = file.size();
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToCalculateFileSize(e);
} }
} }
return bodySize; return bodySize;

View File

@ -69,7 +69,7 @@ public final class LargeServerMessageInSync implements ReplicatedLargeMessage {
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.warn("Error while sincing data on largeMessageInSync::" + mainLM); ActiveMQServerLogger.LOGGER.errorWhileSyncingData(mainLM.toString(), e);
} }
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {

View File

@ -819,7 +819,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
ServerSession session) { ServerSession session) {
session.markTXFailed(t); session.markTXFailed(t);
if (requiresResponse) { if (requiresResponse) {
ActiveMQServerLogger.LOGGER.warn("Sending unexpected exception to the client", t); ActiveMQServerLogger.LOGGER.sendingUnexpectedExceptionToClient(t);
ActiveMQException activeMQInternalErrorException = new ActiveMQInternalErrorException(); ActiveMQException activeMQInternalErrorException = new ActiveMQInternalErrorException();
activeMQInternalErrorException.initCause(t); activeMQInternalErrorException.initCause(t);
response = new ActiveMQExceptionMessage(activeMQInternalErrorException); response = new ActiveMQExceptionMessage(activeMQInternalErrorException);

View File

@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.remoting.impl.AbstractAcceptor;
import org.apache.activemq.artemis.core.security.ActiveMQPrincipal; import org.apache.activemq.artemis.core.security.ActiveMQPrincipal;
import org.apache.activemq.artemis.core.server.ActiveMQComponent; import org.apache.activemq.artemis.core.server.ActiveMQComponent;
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle; import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.core.server.cluster.ClusterConnection; import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
import org.apache.activemq.artemis.core.server.management.Notification; import org.apache.activemq.artemis.core.server.management.Notification;
import org.apache.activemq.artemis.core.server.management.NotificationService; import org.apache.activemq.artemis.core.server.management.NotificationService;
@ -170,7 +171,7 @@ public final class InVMAcceptor extends AbstractAcceptor {
try { try {
notificationService.sendNotification(notification); notificationService.sendNotification(notification);
} catch (Exception e) { } catch (Exception e) {
logger.warn("failed to send notification", e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToSendNotification(e);
} }
} }

View File

@ -613,7 +613,7 @@ public class NettyAcceptor extends AbstractAcceptor {
try { try {
notificationService.sendNotification(notification); notificationService.sendNotification(notification);
} catch (Exception e) { } catch (Exception e) {
logger.warn("failed to send notification", e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToSendNotification(e);
} }
} }

View File

@ -714,7 +714,7 @@ public class RemotingServiceImpl implements RemotingService, ServerConnectionLif
// failure detection could be affected // failure detection could be affected
conn.flush(); conn.flush();
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToFlushOutstandingDataFromTheConnection(e);
} }
} }

View File

@ -402,7 +402,7 @@ public final class ReplicationManager implements ActiveMQComponent {
OperationContext ctx = pendingTokens.poll(); OperationContext ctx = pendingTokens.poll();
if (ctx == null) { if (ctx == null) {
logger.warn("Missing replication token on queue"); ActiveMQServerLogger.LOGGER.missingReplicationTokenOnQueue();
return; return;
} }
ctx.replicationDone(); ctx.replicationDone();

View File

@ -31,6 +31,7 @@ package org.apache.activemq.artemis.core.server;
* so an INFO message would be 101000 to 101999 * so an INFO message would be 101000 to 101999
*/ */
import javax.naming.NamingException;
import javax.transaction.xa.Xid; import javax.transaction.xa.Xid;
import java.io.File; import java.io.File;
import java.net.SocketAddress; import java.net.SocketAddress;
@ -394,6 +395,38 @@ public interface ActiveMQServerLogger extends BasicLogger {
@Message(id = 221071, value = "Failing over based on quorum vote results.", format = Message.Format.MESSAGE_FORMAT) @Message(id = 221071, value = "Failing over based on quorum vote results.", format = Message.Format.MESSAGE_FORMAT)
void failingOverBasedOnQuorumVoteResults(); void failingOverBasedOnQuorumVoteResults();
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221072, value = "Can't find roles for the subject.", format = Message.Format.MESSAGE_FORMAT)
void failedToFindRolesForTheSubject(@Cause Exception e);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221073, value = "Can't add role principal.", format = Message.Format.MESSAGE_FORMAT)
void failedAddRolePrincipal(@Cause Exception e);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221074, value = "Debug started : size = {0} bytes, messages = {1}", format = Message.Format.MESSAGE_FORMAT)
void debugStarted(Long globalSizeBytes, Long numberOfMessages);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221075, value = "Usage of wildcardRoutingEnabled configuration property is deprecated, please use wildCardConfiguration.enabled instead", format = Message.Format.MESSAGE_FORMAT)
void deprecatedWildcardRoutingEnabled();
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221076, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
void onDestroyConnectionWithSessionMetadata(String msg);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221077, value = "There is no queue with ID {0}, deleting record {1}", format = Message.Format.MESSAGE_FORMAT)
void infoNoQueueWithID(Long id, Long record);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221078, value = "Scaled down {0} messages total.", format = Message.Format.MESSAGE_FORMAT)
void infoScaledDownMessages(Long num);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 221079, value = "Ignoring prepare on xid as already called : {0}", format = Message.Format.MESSAGE_FORMAT)
void ignoringPrepareOnXidAlreadyCalled(String xid);
@LogMessage(level = Logger.Level.WARN) @LogMessage(level = Logger.Level.WARN)
@Message(id = 222000, value = "ActiveMQServer is being finalized and has not been stopped. Please remember to stop the server before letting it go out of scope", @Message(id = 222000, value = "ActiveMQServer is being finalized and has not been stopped. Please remember to stop the server before letting it go out of scope",
format = Message.Format.MESSAGE_FORMAT) format = Message.Format.MESSAGE_FORMAT)
@ -425,9 +458,6 @@ public interface ActiveMQServerLogger extends BasicLogger {
@LogMessage(level = Logger.Level.WARN) @LogMessage(level = Logger.Level.WARN)
@Message(id = 222008, value = "unable to restart server, please kill and restart manually", format = Message.Format.MESSAGE_FORMAT) @Message(id = 222008, value = "unable to restart server, please kill and restart manually", format = Message.Format.MESSAGE_FORMAT)
void serverRestartWarning();
@LogMessage(level = Logger.Level.WARN)
void serverRestartWarning(@Cause Exception e); void serverRestartWarning(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN) @LogMessage(level = Logger.Level.WARN)
@ -1348,6 +1378,206 @@ public interface ActiveMQServerLogger extends BasicLogger {
@Message(id = 222218, value = "Server disconnecting: {0}", format = Message.Format.MESSAGE_FORMAT) @Message(id = 222218, value = "Server disconnecting: {0}", format = Message.Format.MESSAGE_FORMAT)
void disconnectCritical(String reason, @Cause Exception e); void disconnectCritical(String reason, @Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222219, value = "File {0} does not exist",
format = Message.Format.MESSAGE_FORMAT)
void fileDoesNotExist(String path);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222220, value = " Error while cleaning paging on queue {0}", format = Message.Format.MESSAGE_FORMAT)
void errorCleaningPagingOnQueue(@Cause Exception e, String queue);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222221, value = "Error while cleaning page, during the commit", format = Message.Format.MESSAGE_FORMAT)
void errorCleaningPagingDuringCommit(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222222, value = "Error while deleting page-complete-record", format = Message.Format.MESSAGE_FORMAT)
void errorDeletingPageCompleteRecord(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222223, value = "Failed to calculate message memory estimate", format = Message.Format.MESSAGE_FORMAT)
void errorCalculateMessageMemoryEstimate(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222224, value = "Failed to calculate scheduled delivery time", format = Message.Format.MESSAGE_FORMAT)
void errorCalculateScheduledDeliveryTime(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222225, value = "Sending unexpected exception to the client", format = Message.Format.MESSAGE_FORMAT)
void sendingUnexpectedExceptionToClient(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222226, value = "Connection configuration is null for connectorName {0}", format = Message.Format.MESSAGE_FORMAT)
void connectionConfigurationIsNull(String connectorName);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222227, value = "Failed to process an event", format = Message.Format.MESSAGE_FORMAT)
void failedToProcessEvent(@Cause NamingException e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222228, value = "Missing replication token on queue", format = Message.Format.MESSAGE_FORMAT)
void missingReplicationTokenOnQueue();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222229, value = "Failed to perform rollback", format = Message.Format.MESSAGE_FORMAT)
void failedToPerformRollback(@Cause IllegalStateException e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222230, value = "Failed to send notification", format = Message.Format.MESSAGE_FORMAT)
void failedToSendNotification(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222231, value = "Failed to flush outstanding data from the connection", format = Message.Format.MESSAGE_FORMAT)
void failedToFlushOutstandingDataFromTheConnection(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222232, value = "Unable to acquire lock", format = Message.Format.MESSAGE_FORMAT)
void unableToAcquireLock(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222233, value = "Unable to destroy connection with session metadata", format = Message.Format.MESSAGE_FORMAT)
void unableDestroyConnectionWithSessionMetadata(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222234, value = "Unable to deactivate a callback", format = Message.Format.MESSAGE_FORMAT)
void unableToDeactiveCallback(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222235, value = "Unable to inject a monitor", format = Message.Format.MESSAGE_FORMAT)
void unableToInjectMonitor(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222236, value = "Unable to flush deliveries", format = Message.Format.MESSAGE_FORMAT)
void unableToFlushDeliveries(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222237, value = "Unable to flush deliveries", format = Message.Format.MESSAGE_FORMAT)
void unableToCancelRedistributor(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222238, value = "Unable to commit transaction", format = Message.Format.MESSAGE_FORMAT)
void unableToCommitTransaction(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222239, value = "Unable to delete Queue status", format = Message.Format.MESSAGE_FORMAT)
void unableToDeleteQueueStatus(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222240, value = "Unable to pause a Queue", format = Message.Format.MESSAGE_FORMAT)
void unableToPauseQueue(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222241, value = "Unable to resume a Queue", format = Message.Format.MESSAGE_FORMAT)
void unableToResumeQueue(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222242, value = "Unable to obtain message priority, using default ", format = Message.Format.MESSAGE_FORMAT)
void unableToGetMessagePriority(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222243, value = "Unable to extract GroupID from message", format = Message.Format.MESSAGE_FORMAT)
void unableToExtractGroupID(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222244, value = "Unable to check if message expired", format = Message.Format.MESSAGE_FORMAT)
void unableToCheckIfMessageExpired(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222245, value = "Unable to perform post acknowledge", format = Message.Format.MESSAGE_FORMAT)
void unableToPerformPostAcknowledge(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222246, value = "Unable to rollback on close", format = Message.Format.MESSAGE_FORMAT)
void unableToRollbackOnClose(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222247, value = "Unable to close consumer", format = Message.Format.MESSAGE_FORMAT)
void unableToCloseConsumer(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222248, value = "Unable to remove consumer", format = Message.Format.MESSAGE_FORMAT)
void unableToRemoveConsumer(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222249, value = "Unable to rollback on TX timed out", format = Message.Format.MESSAGE_FORMAT)
void unableToRollbackOnTxTimedOut(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222250, value = "Unable to delete heuristic completion from storage manager", format = Message.Format.MESSAGE_FORMAT)
void unableToDeleteHeuristicCompletion(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222251, value = "Unable to start replication", format = Message.Format.MESSAGE_FORMAT)
void unableToStartReplication(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222252, value = "Unable to calculate file size", format = Message.Format.MESSAGE_FORMAT)
void unableToCalculateFileSize(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222253, value = "Error while syncing data on largeMessageInSync:: {0}", format = Message.Format.MESSAGE_FORMAT)
void errorWhileSyncingData(String target, @Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222254, value = "Invalid record type {0}", format = Message.Format.MESSAGE_FORMAT)
void invalidRecordType(byte type, @Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222255, value = "Unable to calculate file store usage", format = Message.Format.MESSAGE_FORMAT)
void unableToCalculateFileStoreUsage(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222256, value = "Failed to unregister acceptors", format = Message.Format.MESSAGE_FORMAT)
void failedToUnregisterAcceptors(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222257, value = "Failed to decrement message reference count", format = Message.Format.MESSAGE_FORMAT)
void failedToDecrementMessageReferenceCount(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222258, value = "Error on deleting queue {0}", format = Message.Format.MESSAGE_FORMAT)
void errorOnDeletingQueue(String queueName, @Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222259, value = "Failed to flush the executor", format = Message.Format.MESSAGE_FORMAT)
void failedToFlushExecutor(@Cause InterruptedException e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222260, value = "Failed to perform rollback", format = Message.Format.MESSAGE_FORMAT)
void failedToRollback(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222261, value = "Failed to activate a backup", format = Message.Format.MESSAGE_FORMAT)
void failedToActivateBackup(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222262, value = "Failed to stop cluster manager", format = Message.Format.MESSAGE_FORMAT)
void failedToStopClusterManager(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222263, value = "Failed to stop cluster connection", format = Message.Format.MESSAGE_FORMAT)
void failedToStopClusterConnection(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222264, value = "Failed to process message reference after rollback", format = Message.Format.MESSAGE_FORMAT)
void failedToProcessMessageReferenceAfterRollback(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222265, value = "Failed to finish delivery, unable to lock delivery", format = Message.Format.MESSAGE_FORMAT)
void failedToFinishDelivery(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222266, value = "Failed to send request to the node", format = Message.Format.MESSAGE_FORMAT)
void failedToSendRequestToNode(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222267, value = "Failed to disconnect bindings", format = Message.Format.MESSAGE_FORMAT)
void failedToDisconnectBindings(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222268, value = "Failed to remove a record", format = Message.Format.MESSAGE_FORMAT)
void failedToRemoveRecord(@Cause Exception e);
@LogMessage(level = Logger.Level.ERROR) @LogMessage(level = Logger.Level.ERROR)
@Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT) @Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
@ -1654,4 +1884,28 @@ public interface ActiveMQServerLogger extends BasicLogger {
@LogMessage(level = Logger.Level.WARN) @LogMessage(level = Logger.Level.WARN)
@Message(id = 224078, value = "The size of duplicate cache detection (<id_cache-size/>) appears to be too large {0}. It should be no greater than the number of messages that can be squeezed into conformation buffer (<confirmation-window-size/>) {1}.", format = Message.Format.MESSAGE_FORMAT) @Message(id = 224078, value = "The size of duplicate cache detection (<id_cache-size/>) appears to be too large {0}. It should be no greater than the number of messages that can be squeezed into conformation buffer (<confirmation-window-size/>) {1}.", format = Message.Format.MESSAGE_FORMAT)
void duplicateCacheSizeWarning(int idCacheSize, int confirmationWindowSize); void duplicateCacheSizeWarning(int idCacheSize, int confirmationWindowSize);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224082, value = "Failed to invoke an interceptor", format = Message.Format.MESSAGE_FORMAT)
void failedToInvokeAninterceptor(@Cause Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224083, value = "Failed to close context", format = Message.Format.MESSAGE_FORMAT)
void failedToCloseContext(@Cause Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224084, value = "Failed to open context", format = Message.Format.MESSAGE_FORMAT)
void failedToOpenContext(@Cause Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224085, value = "Failed to load property {0}, reason: {1}", format = Message.Format.MESSAGE_FORMAT)
void failedToLoadProperty(@Cause Exception e, String key, String reason);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224086, value = "Caught unexpected exception", format = Message.Format.MESSAGE_FORMAT)
void caughtUnexpectedException(@Cause NamingException e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224087, value = "Error announcing backup: backupServerLocator is null. {0}", format = Message.Format.MESSAGE_FORMAT)
void errorAnnouncingBackup(String backupManager);
} }

View File

@ -235,7 +235,7 @@ public class BackupManager implements ActiveMQComponent {
ServerLocatorInternal localBackupLocator = backupServerLocator; ServerLocatorInternal localBackupLocator = backupServerLocator;
if (localBackupLocator == null) { if (localBackupLocator == null) {
if (!stopping) if (!stopping)
ActiveMQServerLogger.LOGGER.error("Error announcing backup: backupServerLocator is null. " + this); ActiveMQServerLogger.LOGGER.errorAnnouncingBackup(this.toString());
return; return;
} }
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {

View File

@ -510,7 +510,7 @@ public final class ClusterManager implements ActiveMQComponent {
try { try {
manager.stop(); manager.stop();
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToStopClusterManager(e);
} }
} }
@ -550,7 +550,7 @@ public final class ClusterManager implements ActiveMQComponent {
try { try {
clusterConnection.stop(); clusterConnection.stop();
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToStopClusterConnection(e);
} }
} }
clearClusterConnections(); clearClusterConnections();

View File

@ -71,7 +71,7 @@ public class ColocatedHAManager implements HAManager {
try { try {
activeMQServer.stop(); activeMQServer.stop();
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.errorStoppingServer(e);
} }
} }
backupServers.clear(); backupServers.clear();

View File

@ -1484,7 +1484,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
record.close(); record.close();
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e); ActiveMQServerLogger.LOGGER.failedToRemoveRecord(e);
} }
} }
@ -1497,7 +1497,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
record.disconnectBindings(); record.disconnectBindings();
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToDisconnectBindings(e);
} }
} }

View File

@ -131,7 +131,7 @@ public class Redistributor implements Consumer {
boolean ok = pendingRuns.await(10000); boolean ok = pendingRuns.await(10000);
return ok; return ok;
} catch (InterruptedException e) { } catch (InterruptedException e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToFlushExecutor(e);
return false; return false;
} }
} }
@ -181,9 +181,7 @@ public class Redistributor implements Consumer {
tx.rollback(); tx.rollback();
} catch (Exception e2) { } catch (Exception e2) {
// Nothing much we can do now // Nothing much we can do now
ActiveMQServerLogger.LOGGER.failedToRollback(e2);
// TODO log
ActiveMQServerLogger.LOGGER.warn(e2.getMessage(), e2);
} }
} }
} }

View File

@ -680,7 +680,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
try { try {
activationLock.acquire(); activationLock.acquire();
} catch (Exception e) { } catch (Exception e) {
logger.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToAcquireLock(e);
} }
} }
@ -1306,7 +1306,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
sessions.remove(session.getName()); sessions.remove(session.getName());
} }
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableDestroyConnectionWithSessionMetadata(e);
} }
} }
@ -1319,7 +1319,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
return operationsExecuted.toString(); return operationsExecuted.toString();
} finally { } finally {
// This operation is critical for the knowledge of the admin, so we need to add info logs for later knowledge // This operation is critical for the knowledge of the admin, so we need to add info logs for later knowledge
ActiveMQServerLogger.LOGGER.info(operationsExecuted.toString()); ActiveMQServerLogger.LOGGER.onDestroyConnectionWithSessionMetadata(operationsExecuted.toString());
} }
} }
@ -2165,7 +2165,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
} catch (Throwable e) { } catch (Throwable e) {
// https://bugzilla.redhat.com/show_bug.cgi?id=1009530: // https://bugzilla.redhat.com/show_bug.cgi?id=1009530:
// we won't interrupt the shutdown sequence because of a failed callback here // we won't interrupt the shutdown sequence because of a failed callback here
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToDeactiveCallback(e);
} }
} }
} }
@ -2410,7 +2410,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
try { try {
injectMonitor(new FileStoreMonitor(getScheduledPool(), executorFactory.getExecutor(), configuration.getDiskScanPeriod(), TimeUnit.MILLISECONDS, configuration.getMaxDiskUsage() / 100f, shutdownOnCriticalIO)); injectMonitor(new FileStoreMonitor(getScheduledPool(), executorFactory.getExecutor(), configuration.getDiskScanPeriod(), TimeUnit.MILLISECONDS, configuration.getMaxDiskUsage() / 100f, shutdownOnCriticalIO));
} catch (Exception e) { } catch (Exception e) {
logger.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToInjectMonitor(e);
} }
} }

View File

@ -126,7 +126,7 @@ public class ColocatedActivation extends LiveActivation {
try { try {
started = colocatedHAManager.activateBackup(backupRequestMessage.getBackupSize(), backupRequestMessage.getJournalDirectory(), backupRequestMessage.getBindingsDirectory(), backupRequestMessage.getLargeMessagesDirectory(), backupRequestMessage.getPagingDirectory(), backupRequestMessage.getNodeID()); started = colocatedHAManager.activateBackup(backupRequestMessage.getBackupSize(), backupRequestMessage.getJournalDirectory(), backupRequestMessage.getBindingsDirectory(), backupRequestMessage.getLargeMessagesDirectory(), backupRequestMessage.getPagingDirectory(), backupRequestMessage.getNodeID());
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToActivateBackup(e);
} }
channel.send(new BackupResponseMessage(started)); channel.send(new BackupResponseMessage(started));
} else if (activationChannelHandler != null) { } else if (activationChannelHandler != null) {
@ -220,7 +220,7 @@ public class ColocatedActivation extends LiveActivation {
}, colocatedPolicy.getBackupRequestRetryInterval(), TimeUnit.MILLISECONDS); }, colocatedPolicy.getBackupRequestRetryInterval(), TimeUnit.MILLISECONDS);
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToSendRequestToNode(e);
} }
} else { } else {
nodes.clear(); nodes.clear();

View File

@ -412,7 +412,7 @@ public class LegacyLDAPSecuritySettingPlugin implements SecuritySettingPlugin {
} }
} }
} catch (NamingException e) { } catch (NamingException e) {
logger.warn("Failed to process an event", e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToProcessEvent(e);
} }
} }
@ -464,7 +464,7 @@ public class LegacyLDAPSecuritySettingPlugin implements SecuritySettingPlugin {
} }
} }
} catch (NamingException e) { } catch (NamingException e) {
logger.warn("Failed to process an event", e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToProcessEvent(e);
} }
} }
@ -492,7 +492,7 @@ public class LegacyLDAPSecuritySettingPlugin implements SecuritySettingPlugin {
*/ */
public void namingExceptionThrown(NamingExceptionEvent namingExceptionEvent) { public void namingExceptionThrown(NamingExceptionEvent namingExceptionEvent) {
context = null; context = null;
ActiveMQServerLogger.LOGGER.error("Caught unexpected exception.", namingExceptionEvent.getException()); ActiveMQServerLogger.LOGGER.caughtUnexpectedException(namingExceptionEvent.getException());
} }
protected class LDAPNamespaceChangeListener implements NamespaceChangeListener, ObjectChangeListener { protected class LDAPNamespaceChangeListener implements NamespaceChangeListener, ObjectChangeListener {

View File

@ -724,7 +724,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
return false; return false;
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToFlushDeliveries(e);
return false; return false;
} }
} }
@ -770,7 +770,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
cancelRedistributor(); cancelRedistributor();
} catch (Exception e) { } catch (Exception e) {
// nothing that could be done anyway.. just logging // nothing that could be done anyway.. just logging
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToCancelRedistributor(e);
} }
} }
}); });
@ -1691,7 +1691,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
tx.commit(); tx.commit();
} }
} catch (Exception e) { } catch (Exception e) {
logger.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToCommitTransaction(e);
} }
// If empty we need to schedule depaging to make sure we would depage expired messages as well // If empty we need to schedule depaging to make sure we would depage expired messages as well
@ -1923,7 +1923,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
try { try {
storageManager.deleteQueueStatus(pauseStatusRecord); storageManager.deleteQueueStatus(pauseStatusRecord);
} catch (Exception e) { } catch (Exception e) {
logger.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToDeleteQueueStatus(e);
} }
} }
this.pauseStatusRecord = recordID; this.pauseStatusRecord = recordID;
@ -1940,7 +1940,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
pauseStatusRecord = storageManager.storeQueueStatus(this.id, QueueStatus.PAUSED); pauseStatusRecord = storageManager.storeQueueStatus(this.id, QueueStatus.PAUSED);
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToPauseQueue(e);
} }
paused = true; paused = true;
} }
@ -1953,7 +1953,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
try { try {
storageManager.deleteQueueStatus(pauseStatusRecord); storageManager.deleteQueueStatus(pauseStatusRecord);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToResumeQueue(e);
} }
pauseStatusRecord = -1; pauseStatusRecord = -1;
} }
@ -2043,7 +2043,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
try { try {
return ref.getMessage().getPriority(); return ref.getMessage().getPriority();
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToGetMessagePriority(e);
return 4; // the default one in case of failure return 4; // the default one in case of failure
} }
} }
@ -2274,7 +2274,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
// But we don't use the groupID on internal queues (clustered queues) otherwise the group map would leak forever // But we don't use the groupID on internal queues (clustered queues) otherwise the group map would leak forever
return ref.getMessage().getGroupID(); return ref.getMessage().getGroupID();
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToExtractGroupID(e);
return null; return null;
} }
} }
@ -2791,7 +2791,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
return false; return false;
} }
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToCheckIfMessageExpired(e);
return false; return false;
} }
} }
@ -2844,7 +2844,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
try { try {
message = ref.getMessage(); message = ref.getMessage();
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToPerformPostAcknowledge(e);
message = null; message = null;
} }

View File

@ -129,7 +129,7 @@ public class RefsOperation extends TransactionOperationAbstract {
} }
ackedTX.commit(true); ackedTX.commit(true);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToProcessMessageReferenceAfterRollback(e);
} }
} }
} }
@ -171,7 +171,7 @@ public class RefsOperation extends TransactionOperationAbstract {
// This could happen on after commit, since the page could be deleted on file earlier by another thread // This could happen on after commit, since the page could be deleted on file earlier by another thread
logger.debug(e); logger.debug(e);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToDecrementMessageReferenceCount(e);
} }
} }

View File

@ -94,7 +94,7 @@ public class ScaleDownHandler {
ClusterControl clusterControl = clusterController.connectToNodeInCluster((ClientSessionFactoryInternal) sessionFactory); ClusterControl clusterControl = clusterController.connectToNodeInCluster((ClientSessionFactoryInternal) sessionFactory);
clusterControl.authorize(); clusterControl.authorize();
long num = scaleDownMessages(sessionFactory, targetNodeId, clusterControl.getClusterUser(), clusterControl.getClusterPassword()); long num = scaleDownMessages(sessionFactory, targetNodeId, clusterControl.getClusterUser(), clusterControl.getClusterPassword());
ActiveMQServerLogger.LOGGER.info("Scaled down " + num + " messages total."); ActiveMQServerLogger.LOGGER.infoScaledDownMessages(num);
scaleDownTransactions(sessionFactory, resourceManager, clusterControl.getClusterUser(), clusterControl.getClusterPassword()); scaleDownTransactions(sessionFactory, resourceManager, clusterControl.getClusterUser(), clusterControl.getClusterPassword());
scaleDownDuplicateIDs(duplicateIDMap, sessionFactory, managementAddress, clusterControl.getClusterUser(), clusterControl.getClusterPassword()); scaleDownDuplicateIDs(duplicateIDMap, sessionFactory, managementAddress, clusterControl.getClusterUser(), clusterControl.getClusterPassword());
clusterControl.announceScaleDown(new SimpleString(this.targetNodeId), nodeManager.getNodeId()); clusterControl.announceScaleDown(new SimpleString(this.targetNodeId), nodeManager.getNodeId());

View File

@ -690,7 +690,7 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToFinishDelivery(e);
return false; return false;
} }
} }

View File

@ -365,7 +365,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
try { try {
rollback(failed, false); rollback(failed, false);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToRollbackOnClose(e);
} }
} }
} }
@ -378,11 +378,11 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
try { try {
consumer.close(failed); consumer.close(failed);
} catch (Throwable e) { } catch (Throwable e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToCloseConsumer(e);
try { try {
consumer.removeItself(); consumer.removeItself();
} catch (Throwable e2) { } catch (Throwable e2) {
ActiveMQServerLogger.LOGGER.warn(e2.getMessage(), e2); ActiveMQServerLogger.LOGGER.unableToRemoveConsumer(e2);
} }
} }
} }
@ -998,7 +998,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
try { try {
storageManager.deleteHeuristicCompletion(id); storageManager.deleteHeuristicCompletion(id);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToDeleteHeuristicCompletion(e);
throw new ActiveMQXAException(XAException.XAER_RMFAIL); throw new ActiveMQXAException(XAException.XAER_RMFAIL);
} }
} else { } else {
@ -1078,7 +1078,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
// at this point we would be better on rolling back this session as a way to prevent consumers from holding their messages // at this point we would be better on rolling back this session as a way to prevent consumers from holding their messages
this.rollback(false); this.rollback(false);
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.unableToRollbackOnTxTimedOut(e);
} }
throw new ActiveMQXAException(XAException.XAER_NOTA, "Cannot find xid in resource manager: " + xid); throw new ActiveMQXAException(XAException.XAER_NOTA, "Cannot find xid in resource manager: " + xid);
@ -1200,7 +1200,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
if (theTx.getState() == Transaction.State.SUSPENDED) { if (theTx.getState() == Transaction.State.SUSPENDED) {
throw new ActiveMQXAException(XAException.XAER_PROTO, "Cannot prepare transaction, it is suspended " + xid); throw new ActiveMQXAException(XAException.XAER_PROTO, "Cannot prepare transaction, it is suspended " + xid);
} else if (theTx.getState() == Transaction.State.PREPARED) { } else if (theTx.getState() == Transaction.State.PREPARED) {
ActiveMQServerLogger.LOGGER.info("ignoring prepare on xid as already called :" + xid); ActiveMQServerLogger.LOGGER.ignoringPrepareOnXidAlreadyCalled(xid.toString());
} else { } else {
theTx.prepare(); theTx.prepare();
} }
@ -1243,7 +1243,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
ActiveMQServerLogger.LOGGER.errorCompletingContext(new Exception("warning")); ActiveMQServerLogger.LOGGER.errorCompletingContext(new Exception("warning"));
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.errorCompletingContext(e);
} }
} }

View File

@ -103,7 +103,7 @@ public final class SharedStoreBackupActivation extends Activation {
activeMQServer.start(); activeMQServer.start();
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.serverRestartWarning(); ActiveMQServerLogger.LOGGER.serverRestartWarning(e);
} }
} }
}); });
@ -227,8 +227,7 @@ public final class SharedStoreBackupActivation extends Activation {
activeMQServer.start(); activeMQServer.start();
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); ActiveMQServerLogger.LOGGER.serverRestartWarning(e);
ActiveMQServerLogger.LOGGER.serverRestartWarning();
} }
} }
}); });

View File

@ -43,7 +43,7 @@ public class TransientQueueManagerImpl implements TransientQueueManager {
try { try {
server.destroyQueue(queueName, null, false); server.destroyQueue(queueName, null, false);
} catch (ActiveMQException e) { } catch (ActiveMQException e) {
ActiveMQServerLogger.LOGGER.warn("Error on deleting queue " + queueName + ", " + e.getMessage(), e); ActiveMQServerLogger.LOGGER.errorOnDeletingQueue(queueName.toString(), e);
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.errorRemovingTempQueue(e, queueName); ActiveMQServerLogger.LOGGER.errorRemovingTempQueue(e, queueName);

View File

@ -304,7 +304,7 @@ public class ManagementServiceImpl implements ManagementService {
try { try {
unregisterAcceptor(name); unregisterAcceptor(name);
} catch (Exception e) { } catch (Exception e) {
logger.warn("Failed to unregister acceptors", e.getMessage(), e); ActiveMQServerLogger.LOGGER.failedToUnregisterAcceptors(e);
} }
} }
} }

View File

@ -102,7 +102,7 @@ public class ReloadManagerImpl extends ActiveMQScheduledComponent implements Rel
} }
if (!file.exists()) { if (!file.exists()) {
logger.warn("File " + file + " does not exist"); ActiveMQServerLogger.LOGGER.fileDoesNotExist(file.toString());
} }
this.lastModified = file.lastModified(); this.lastModified = file.lastModified();

View File

@ -378,7 +378,7 @@ public class TransactionImpl implements Transaction {
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
// Something happened before and the TX didn't make to the Journal / Storage // Something happened before and the TX didn't make to the Journal / Storage
// We will like to execute afterRollback and clear anything pending // We will like to execute afterRollback and clear anything pending
ActiveMQServerLogger.LOGGER.warn(e); ActiveMQServerLogger.LOGGER.failedToPerformRollback(e);
} }
// We want to make sure that nothing else gets done after the commit is issued // We want to make sure that nothing else gets done after the commit is issued
// this will eliminate any possibility or races // this will eliminate any possibility or races

View File

@ -40,7 +40,7 @@ public abstract class AbstractProtocolManager<P, I extends BaseInterceptor<P>, C
break; break;
} }
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.error(e); ActiveMQServerLogger.LOGGER.failedToInvokeAninterceptor(e);
} }
} }
} }

View File

@ -29,6 +29,7 @@ import java.util.Set;
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration; import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
import org.apache.activemq.artemis.core.security.CheckType; import org.apache.activemq.artemis.core.security.CheckType;
import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.security.Role;
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
import org.apache.activemq.artemis.spi.core.security.jaas.JaasCallbackHandler; import org.apache.activemq.artemis.spi.core.security.jaas.JaasCallbackHandler;
import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal; import org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal;
@ -142,7 +143,7 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager3 {
try { try {
rolesForSubject.addAll(localSubject.getPrincipals(Class.forName(rolePrincipalClass).asSubclass(Principal.class))); rolesForSubject.addAll(localSubject.getPrincipals(Class.forName(rolePrincipalClass).asSubclass(Principal.class)));
} catch (Exception e) { } catch (Exception e) {
logger.info("Can't find roles for the subject", e); ActiveMQServerLogger.LOGGER.failedToFindRolesForTheSubject(e);
} }
if (rolesForSubject.size() > 0 && rolesWithPermission.size() > 0) { if (rolesForSubject.size() > 0 && rolesWithPermission.size() > 0) {
Iterator<Principal> rolesForSubjectIter = rolesForSubject.iterator(); Iterator<Principal> rolesForSubjectIter = rolesForSubject.iterator();
@ -199,7 +200,7 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager3 {
try { try {
principals.add(createGroupPrincipal(role.getName(), rolePrincipalClass)); principals.add(createGroupPrincipal(role.getName(), rolePrincipalClass));
} catch (Exception e) { } catch (Exception e) {
logger.info("Can't add role principal", e); ActiveMQServerLogger.LOGGER.failedAddRolePrincipal(e);
} }
} }
} }

View File

@ -193,7 +193,7 @@ public class LDAPLoginModule implements LoginModule {
context.close(); context.close();
context = null; context = null;
} catch (Exception e) { } catch (Exception e) {
ActiveMQServerLogger.LOGGER.error(e.toString()); ActiveMQServerLogger.LOGGER.failedToCloseContext(e);
} }
} }
} }
@ -576,7 +576,7 @@ public class LDAPLoginModule implements LoginModule {
} catch (NamingException e) { } catch (NamingException e) {
closeContext(); closeContext();
ActiveMQServerLogger.LOGGER.error(e.toString()); ActiveMQServerLogger.LOGGER.failedToOpenContext(e);
throw e; throw e;
} }
} }

View File

@ -57,7 +57,7 @@ public class ReloadableProperties {
logger.debug("Load of: " + key); logger.debug("Load of: " + key);
} }
} catch (IOException e) { } catch (IOException e) {
ActiveMQServerLogger.LOGGER.error("Failed to load: " + key + ", reason:" + e.getLocalizedMessage()); ActiveMQServerLogger.LOGGER.failedToLoadProperty(e, key.toString(), e.getLocalizedMessage());
if (key.isDebug()) { if (key.isDebug()) {
logger.debug("Load of: " + key + ", failure exception" + e); logger.debug("Load of: " + key + ", failure exception" + e);
} }