activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [4/5] https://issues.apache.org/jira/browse/AMQ-4721
Date Fri, 13 Sep 2013 18:53:56 GMT
http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
index 9d53759..bfbcfe6 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
@@ -131,7 +131,7 @@ public class ManagedRegionBroker extends RegionBroker {
             try {
                 managementContext.unregisterMBean(name);
             } catch (InstanceNotFoundException e) {
-                LOG.warn("The MBean: " + name + " is no longer registered with JMX");
+                LOG.warn("The MBean {} is no longer registered with JMX", name);
             } catch (Exception e) {
                 stopper.onException(this, e);
             }
@@ -170,13 +170,13 @@ public class ManagedRegionBroker extends RegionBroker {
                 view = new TopicView(this, (Topic)destination);
             } else {
                 view = null;
-                LOG.warn("JMX View is not supported for custom destination: " + destination);
+                LOG.warn("JMX View is not supported for custom destination {}", destination);
             }
             if (view != null) {
                 registerDestination(objectName, destName, view);
             }
         } catch (Exception e) {
-            LOG.error("Failed to register destination " + destName, e);
+            LOG.error("Failed to register destination {}", destName, e);
         }
     }
 
@@ -185,7 +185,7 @@ public class ManagedRegionBroker extends RegionBroker {
             ObjectName objectName = BrokerMBeanSupport.createDestinationName(brokerObjectName, destName);
             unregisterDestination(objectName);
         } catch (Exception e) {
-            LOG.error("Failed to unregister " + destName, e);
+            LOG.error("Failed to unregister {}", destName, e);
         }
     }
 
@@ -220,7 +220,7 @@ public class ManagedRegionBroker extends RegionBroker {
             subscriptionMap.put(sub, objectName);
             return objectName;
         } catch (Exception e) {
-            LOG.error("Failed to register subscription " + sub, e);
+            LOG.error("Failed to register subscription {}", sub, e);
             return null;
         }
     }
@@ -294,7 +294,7 @@ public class ManagedRegionBroker extends RegionBroker {
                     managementContext.unregisterMBean(inactiveName);
                 }
             } catch (Exception e) {
-                LOG.error("Failed to unregister subscription " + sub, e);
+                LOG.error("Failed to unregister subscription {}", sub, e);
             }
         }
     }
@@ -317,8 +317,8 @@ public class ManagedRegionBroker extends RegionBroker {
             AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key);
             registeredMBeans.add(key);
         } catch (Throwable e) {
-            LOG.warn("Failed to register MBean: " + key);
-            LOG.debug("Failure reason: " + e, e);
+            LOG.warn("Failed to register MBean {}", key);
+            LOG.debug("Failure reason: ", e);
         }
     }
 
@@ -332,8 +332,8 @@ public class ManagedRegionBroker extends RegionBroker {
             try {
                 managementContext.unregisterMBean(key);
             } catch (Throwable e) {
-                LOG.warn("Failed to unregister MBean: " + key);
-                LOG.debug("Failure reason: " + e, e);
+                LOG.warn("Failed to unregister MBean {}", key);
+                LOG.debug("Failure reason: ", e);
             }
         }
         if (view != null) {
@@ -342,8 +342,8 @@ public class ManagedRegionBroker extends RegionBroker {
                 try {
                     managementContext.unregisterMBean(key);
                 } catch (Throwable e) {
-                    LOG.warn("Failed to unregister slow consumer strategy MBean: " + key);
-                    LOG.debug("Failure reason: " + e, e);
+                    LOG.warn("Failed to unregister slow consumer strategy MBean {}", key);
+                    LOG.debug("Failure reason: ", e);
                 }
             }
         }
@@ -373,8 +373,8 @@ public class ManagedRegionBroker extends RegionBroker {
             AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key);
             registeredMBeans.add(key);
         } catch (Throwable e) {
-            LOG.warn("Failed to register MBean: " + key);
-            LOG.debug("Failure reason: " + e, e);
+            LOG.warn("Failed to register MBean {}", key);
+            LOG.debug("Failure reason: ", e);
         }
     }
 
@@ -388,8 +388,8 @@ public class ManagedRegionBroker extends RegionBroker {
             try {
                 managementContext.unregisterMBean(key);
             } catch (Throwable e) {
-                LOG.warn("Failed to unregister MBean: " + key);
-                LOG.debug("Failure reason: " + e, e);
+                LOG.warn("Failed to unregister MBean {}", key);
+                LOG.debug("Failure reason: ", e);
             }
         }
     }
@@ -425,7 +425,7 @@ public class ManagedRegionBroker extends RegionBroker {
                             managementContext.unregisterMBean(inactiveName);
                         }
                     } catch (Throwable e) {
-                        LOG.error("Unable to unregister inactive durable subscriber: " + subscriptionKey, e);
+                        LOG.error("Unable to unregister inactive durable subscriber {}", subscriptionKey, e);
                     }
                 } else {
                     topicSubscribers.put(key, view);
@@ -437,8 +437,8 @@ public class ManagedRegionBroker extends RegionBroker {
             AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, key);
             registeredMBeans.add(key);
         } catch (Throwable e) {
-            LOG.warn("Failed to register MBean: " + key);
-            LOG.debug("Failure reason: " + e, e);
+            LOG.warn("Failed to register MBean {}", key);
+            LOG.debug("Failure reason: ", e);
         }
 
     }
@@ -452,8 +452,8 @@ public class ManagedRegionBroker extends RegionBroker {
             try {
                 managementContext.unregisterMBean(key);
             } catch (Throwable e) {
-                LOG.warn("Failed to unregister MBean: " + key);
-                LOG.debug("Failure reason: " + e, e);
+                LOG.warn("Failed to unregister MBean {}", key);
+                LOG.debug("Failure reason: ", e);
             }
         }
         DurableSubscriptionView view = (DurableSubscriptionView)durableTopicSubscribers.remove(key);
@@ -483,7 +483,7 @@ public class ManagedRegionBroker extends RegionBroker {
                             SubscriptionInfo info = infos[i];
                             SubscriptionKey key = new SubscriptionKey(info);
                             if (!alreadyKnown(key)) {
-                                LOG.debug("Restoring durable subscription mbean: " + info);
+                                LOG.debug("Restoring durable subscription MBean {}", info);
                                 subscriptions.put(key, info);
                             }
                         }
@@ -500,9 +500,7 @@ public class ManagedRegionBroker extends RegionBroker {
     private boolean alreadyKnown(SubscriptionKey key) {
         boolean known = false;
         known = ((TopicRegion) getTopicRegion()).durableSubscriptionExists(key);
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Sub with key: " + key + ", " + (known ? "": "not") +  " already registered");
-        }
+        LOG.trace("Sub with key: {}, {} already registered", key, (known ? "": "not"));
         return known;
     }
 
@@ -516,14 +514,14 @@ public class ManagedRegionBroker extends RegionBroker {
                 AsyncAnnotatedMBean.registerMBean(asyncInvokeService, mbeanTimeout, managementContext, view, objectName);
                 registeredMBeans.add(objectName);
             } catch (Throwable e) {
-                LOG.warn("Failed to register MBean: " + key);
-                LOG.debug("Failure reason: " + e, e);
+                LOG.warn("Failed to register MBean {}", key);
+                LOG.debug("Failure reason: ", e);
             }
 
             inactiveDurableTopicSubscribers.put(objectName, view);
             subscriptionKeys.put(key, objectName);
         } catch (Exception e) {
-            LOG.error("Failed to register subscription " + info, e);
+            LOG.error("Failed to register subscription {}", info, e);
         }
     }
 
@@ -534,7 +532,7 @@ public class ManagedRegionBroker extends RegionBroker {
             try {
                 c[i] = OpenTypeSupport.convert(messages.get(i));
             } catch (Throwable e) {
-                LOG.error("failed to browse : " + view, e);
+                LOG.error("Failed to browse: {}", view, e);
             }
         }
         return c;
@@ -585,7 +583,7 @@ public class ManagedRegionBroker extends RegionBroker {
                 }
             });
         } catch (Throwable e) {
-            LOG.error("Failed to browse messages for Subscription " + view, e);
+            LOG.error("Failed to browse messages for Subscription {}", view, e);
         }
         return result;
 
@@ -691,8 +689,8 @@ public class ManagedRegionBroker extends RegionBroker {
                 registeredMBeans.add(objectName);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to register MBean: " + strategy);
-            LOG.debug("Failure reason: " + e, e);
+            LOG.warn("Failed to register MBean {}", strategy);
+            LOG.debug("Failure reason: ", e);
         }
         return objectName;
     }
@@ -706,8 +704,8 @@ public class ManagedRegionBroker extends RegionBroker {
                 registeredMBeans.add(objectName);
             }
         } catch (Exception e) {
-            LOG.warn("Failed to register prepared transaction MBean: " + transaction);
-            LOG.debug("Failure reason: " + e, e);
+            LOG.warn("Failed to register prepared transaction MBean {}", transaction);
+            LOG.debug("Failure reason: ", e);
         }
     }
 
@@ -718,12 +716,12 @@ public class ManagedRegionBroker extends RegionBroker {
                 try {
                     managementContext.unregisterMBean(objectName);
                 } catch (Throwable e) {
-                    LOG.warn("Failed to unregister MBean: " + objectName);
-                    LOG.debug("Failure reason: " + e, e);
+                    LOG.warn("Failed to unregister MBean {}", objectName);
+                    LOG.debug("Failure reason: ", e);
                 }
             }
         } catch (Exception e) {
-            LOG.warn("Failed to create object name to unregister " + transaction, e);
+            LOG.warn("Failed to create object name to unregister {}", transaction, e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java
index cf2900b..6f5f206 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTempQueueRegion.java
@@ -19,7 +19,6 @@ package org.apache.activemq.broker.jmx;
 import javax.jms.JMSException;
 import javax.management.ObjectName;
 
-import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.Destination;
 import org.apache.activemq.broker.region.DestinationFactory;

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
index 7ec948b..c79fdd7 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
@@ -97,8 +97,8 @@ public class ManagedTransportConnection extends TransportConnection {
             try {
                 AnnotatedMBean.registerMBean(managementContext, mbean, name);
             } catch (Throwable e) {
-                LOG.warn("Failed to register MBean: " + name);
-                LOG.debug("Failure reason: " + e, e);
+                LOG.warn("Failed to register MBean {}", name);
+                LOG.debug("Failure reason: ", e);
             }
         }
     }
@@ -108,8 +108,8 @@ public class ManagedTransportConnection extends TransportConnection {
             try {
                 managementContext.unregisterMBean(name);
             } catch (Throwable e) {
-                LOG.warn("Failed to unregister mbean: " + name);
-                LOG.debug("Failure reason: " + e, e);
+                LOG.warn("Failed to unregister MBean {}", name);
+                LOG.debug("Failure reason: ", e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
index 6bf8892..e427513 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
@@ -110,7 +110,7 @@ public class ManagementContext implements Service {
                         getMBeanServer().invoke(namingServiceObjectName, "start", null, null);
                     }
                 } catch (Throwable ignore) {
-                    LOG.debug("Error invoking start on mbean " + namingServiceObjectName + ". This exception is ignored.", ignore);
+                    LOG.debug("Error invoking start on MBean {}. This exception is ignored.", namingServiceObjectName, ignore);
                 }
 
                 Thread t = new Thread("JMX connector") {
@@ -135,11 +135,11 @@ public class ManagementContext implements Service {
                                     }
                                     connectorStarting.set(false);
                                 }
-                                LOG.info("JMX consoles can connect to " + server.getAddress());
+                                LOG.info("JMX consoles can connect to {}", server.getAddress());
                             }
                         } catch (IOException e) {
-                            LOG.warn("Failed to start jmx connector: " + e.getMessage() + ". Will restart management to re-create jmx connector, trying to remedy this issue.");
-                            LOG.debug("Reason for failed jmx connector start", e);
+                            LOG.warn("Failed to start JMX connector {}. Will restart management to re-create JMX connector, trying to remedy this issue.", e.getMessage());
+                            LOG.debug("Reason for failed JMX connector start", e);
                         } finally {
                             MDC.remove("activemq.broker");
                         }
@@ -177,7 +177,7 @@ public class ManagementContext implements Service {
                         server.stop();
                     }
                 } catch (IOException e) {
-                    LOG.warn("Failed to stop jmx connector: " + e.getMessage());
+                    LOG.warn("Failed to stop jmx connector: {}", e.getMessage());
                 }
                 // stop naming service mbean
                 try {
@@ -188,7 +188,7 @@ public class ManagementContext implements Service {
                         getMBeanServer().unregisterMBean(namingServiceObjectName);
                     }
                 } catch (Throwable ignore) {
-                    LOG.warn("Error stopping and unregsitering mbean " + namingServiceObjectName + " due " + ignore.getMessage());
+                    LOG.warn("Error stopping and unregsitering MBean {} due to {}", namingServiceObjectName, ignore.getMessage());
                 }
                 namingServiceObjectName = null;
             }
@@ -324,7 +324,7 @@ public class ManagementContext implements Service {
         try {
             result = new ObjectName(tmp);
         } catch (MalformedObjectNameException e) {
-            LOG.error("Couldn't create ObjectName from: " + type + " , " + name);
+            LOG.error("Couldn't create ObjectName from: {}, {}", type, name);
         }
         return result;
     }
@@ -452,16 +452,16 @@ public class ManagementContext implements Service {
                         }
                         return (MBeanServer)answer;
                     } else {
-                        LOG.warn("Could not cast: " + answer + " into an MBeanServer. There must be some classloader strangeness in town");
+                        LOG.warn("Could not cast: {} into an MBeanServer. There must be some classloader strangeness in town", answer);
                     }
                 } else {
-                    LOG.warn("Method getPlatformMBeanServer() does not appear visible on type: " + type.getName());
+                    LOG.warn("Method getPlatformMBeanServer() does not appear visible on type: {}", type.getName());
                 }
             } catch (Exception e) {
-                LOG.warn("Failed to call getPlatformMBeanServer() due to: " + e, e);
+                LOG.warn("Failed to call getPlatformMBeanServer() due to: ", e);
             }
         } else {
-            LOG.trace("Class not found: " + name + " so probably running on Java 1.4");
+            LOG.trace("Class not found: {} so probably running on Java 1.4", name);
         }
         return null;
     }
@@ -516,7 +516,7 @@ public class ManagementContext implements Service {
             Attribute attr = new Attribute("Port", Integer.valueOf(connectorPort));
             mbeanServer.setAttribute(namingServiceObjectName, attr);
         } catch(ClassNotFoundException e) {
-            LOG.debug("Probably not using JRE 1.4: " + e.getLocalizedMessage());
+            LOG.debug("Probably not using JRE 1.4: {}", e.getLocalizedMessage());
         } catch (Throwable e) {
             LOG.debug("Failed to create local registry. This exception will be ignored.", e);
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
index 6f5c541..168bd96 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
@@ -130,9 +130,7 @@ public abstract class AbstractRegion implements Region {
             Destination dest = destinations.get(destination);
             if (dest == null) {
                 if (destination.isTemporary() == false || createIfTemporary) {
-                    if (LOG.isDebugEnabled()) {
-                        LOG.debug(broker.getBrokerName() + " adding destination: " + destination);
-                    }
+                    LOG.debug("{} adding destination: {}", broker.getBrokerName(), destination);
                     dest = createDestination(context, destination);
                     // intercept if there is a valid interceptor defined
                     DestinationInterceptor destinationInterceptor = broker.getDestinationInterceptor();
@@ -196,9 +194,7 @@ public abstract class AbstractRegion implements Region {
             // dropping the subscription.
         }
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(broker.getBrokerName() + " removing destination: " + destination);
-        }
+        LOG.debug("{} removing destination: {}", broker.getBrokerName(), destination);
 
         destinationsLock.writeLock().lock();
         try {
@@ -220,9 +216,7 @@ public abstract class AbstractRegion implements Region {
                 }
 
             } else {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Cannot remove a destination that doesn't exist: " + destination);
-                }
+                LOG.debug("Cannot remove a destination that doesn't exist: {}", destination);
             }
         } finally {
             destinationsLock.writeLock().unlock();
@@ -255,10 +249,7 @@ public abstract class AbstractRegion implements Region {
 
     @SuppressWarnings("unchecked")
     public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(broker.getBrokerName() + " adding consumer: " + info.getConsumerId() + " for destination: "
-                    + info.getDestination());
-        }
+        LOG.debug("{} adding consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() });
         ActiveMQDestination destination = info.getDestination();
         if (destination != null && !destination.isPattern() && !destination.isComposite()) {
             // lets auto-create the destination
@@ -357,10 +348,7 @@ public abstract class AbstractRegion implements Region {
 
     @SuppressWarnings("unchecked")
     public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(broker.getBrokerName() + " removing consumer: " + info.getConsumerId() + " for destination: "
-                    + info.getDestination());
-        }
+        LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() });
 
         Subscription sub = subscriptions.remove(info.getConsumerId());
         // The sub could be removed elsewhere - see ConnectionSplitBroker
@@ -412,12 +400,10 @@ public abstract class AbstractRegion implements Region {
             sub = subscriptions.get(ack.getConsumerId());
             if (sub == null) {
                 if (!consumerExchange.getConnectionContext().isInRecoveryMode()) {
-                    LOG.warn("Ack for non existent subscription, ack:" + ack);
+                    LOG.warn("Ack for non existent subscription, ack: {}", ack);
                     throw new IllegalArgumentException("The subscription does not exist: " + ack.getConsumerId());
                 } else {
-                    if (LOG.isDebugEnabled()) {
-                        LOG.debug("Ack for non existent subscription in recovery, ack:" + ack);
-                    }
+                    LOG.debug("Ack for non existent subscription in recovery, ack: {}", ack);
                     return;
                 }
             }
@@ -582,14 +568,11 @@ public abstract class AbstractRegion implements Region {
                     entry.configurePrefetch(sub);
                 }
             }
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("setting prefetch: " + control.getPrefetch() + ", on subscription: "
-                        + control.getConsumerId() + "; resulting value: " + sub.getConsumerInfo().getCurrentPrefetchSize());
-            }
+            LOG.debug("setting prefetch: {}, on subscription: {}; resulting value: {}", new Object[]{ control.getPrefetch(), control.getConsumerId(), sub.getConsumerInfo().getCurrentPrefetchSize()});
             try {
                 lookup(consumerExchange.getConnectionContext(), control.getDestination(),false).wakeup();
             } catch (Exception e) {
-                LOG.warn("failed to deliver post consumerControl dispatch-wakeup, to destination: " + control.getDestination(), e);
+                LOG.warn("failed to deliver post consumerControl dispatch-wakeup, to destination: {}", control.getDestination(), e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
index e470fab..06a44bf 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractSubscription.java
@@ -101,7 +101,7 @@ public abstract class AbstractSubscription implements Subscription {
         try {
             return (selectorExpression == null || selectorExpression.matches(context)) && this.context.isAllowedToConsume(node);
         } catch (JMSException e) {
-            LOG.info("Selector failed to evaluate: " + e.getMessage(), e);
+            LOG.info("Selector failed to evaluate: {}", e.getMessage(), e);
             return false;
         }
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractTempRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractTempRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractTempRegion.java
index c955caa..5de5123 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractTempRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractTempRegion.java
@@ -100,7 +100,7 @@ public abstract class AbstractTempRegion extends AbstractRegion {
                 dest.dispose(context);
                 dest.stop();
             } catch (Exception e) {
-                LOG.warn("Failed to dispose of " + dest, e);
+                LOG.warn("Failed to dispose of {}", dest, e);
             }
         }
     }
@@ -111,7 +111,7 @@ public abstract class AbstractTempRegion extends AbstractRegion {
             dest.dispose(context);
             dest.stop();
         } catch (Exception e) {
-            LOG.warn("Failed to dispose of " + dest, e);
+            LOG.warn("Failed to dispose of {}", dest, e);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/BaseDestination.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
index 1e97c0e..5edbdf3 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
@@ -612,12 +612,12 @@ public abstract class BaseDestination implements Destination {
 
     protected final void waitForSpace(ConnectionContext context, ProducerBrokerExchange producerBrokerExchange, Usage<?> usage, int highWaterMark, String warning) throws IOException, InterruptedException, ResourceAllocationException {
         if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) {
-            getLog().debug("sendFailIfNoSpace, forcing exception on send, usage:  " + usage + ": " + warning);
+            getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning);
             throw new ResourceAllocationException(warning);
         }
         if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) {
             if (!usage.waitForSpace(systemUsage.getSendFailIfNoSpaceAfterTimeout(), highWaterMark)) {
-                getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: " + usage + ": " + warning);
+                getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning);
                 throw new ResourceAllocationException(warning);
             }
         } else {
@@ -632,7 +632,7 @@ public abstract class BaseDestination implements Destination {
 
                 long now = System.currentTimeMillis();
                 if (now >= nextWarn) {
-                    getLog().info("" + usage + ": " + warning + " (blocking for: " + (now - start) / 1000 + "s)");
+                    getLog().info("{}: {} (blocking for: {}s)", new Object[]{ usage, warning, new Long(((now - start) / 1000))});
                     nextWarn = now + blockedProducerWarningInterval;
                 }
             }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
index b7fa2fe..2fc0b05 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java
@@ -141,9 +141,7 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us
             this.context = context;
             this.info = info;
 
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Activating " + this);
-            }
+            LOG.debug("Activating {}", this);
             if (!keepDurableSubsActive) {
                 for (Destination destination : durableDestinations.values()) {
                     Topic topic = (Topic) destination;
@@ -186,9 +184,7 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us
     }
 
     public void deactivate(boolean keepDurableSubsActive) throws Exception {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Deactivating keepActive=" + keepDurableSubsActive + ", " + this);
-        }
+        LOG.debug("Deactivating keepActive={}, {}", keepDurableSubsActive, this);
         active.set(false);
         offlineTimestamp.set(System.currentTimeMillis());
         this.usageManager.getMemoryUsage().removeUsageListener(this);

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
index 572ae75..81f90fb 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/PrefetchSubscription.java
@@ -30,7 +30,6 @@ import org.apache.activemq.broker.Broker;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.cursors.PendingMessageCursor;
 import org.apache.activemq.broker.region.cursors.VMPendingMessageCursor;
-import org.apache.activemq.command.ActiveMQMessage;
 import org.apache.activemq.command.ConsumerControl;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.command.Message;
@@ -200,13 +199,12 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
 
         if (!okForAckAsDispatchDone.await(0l, TimeUnit.MILLISECONDS)) {
             // suppress unexpected ack exception in this expected case
-            LOG.warn("Ignoring ack received before dispatch; result of failover with an outstanding ack. Acked messages will be replayed if present on this broker. Ignored ack: " + ack);
+            LOG.warn("Ignoring ack received before dispatch; result of failover with an outstanding ack. Acked messages will be replayed if present on this broker. Ignored ack: {}", ack);
             return;
         }
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("ack:" + ack);
-        }
+        LOG.trace("ack: {}", ack);
+
         synchronized(dispatchLock) {
             if (ack.isStandardAck()) {
                 // First check if the ack matches the dispatched. When using failover this might
@@ -268,8 +266,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
                 // this only happens after a reconnect - get an ack which is not
                 // valid
                 if (!callDispatchMatched) {
-                    LOG.warn("Could not correlate acknowledgment with dispatched message: "
-                                  + ack);
+                    LOG.warn("Could not correlate acknowledgment with dispatched message: {}", ack);
                 }
             } else if (ack.isIndividualAck()) {
                 // Message was delivered and acknowledge - but only delete the
@@ -418,8 +415,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
                 }
             }
         } else {
-            LOG.debug("Acknowledgment out of sync (Normally occurs when failover connection reconnects): "
-                    + ack);
+            LOG.debug("Acknowledgment out of sync (Normally occurs when failover connection reconnects): {}", ack);
         }
     }
 
@@ -731,10 +727,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
                         if (node != QueueMessageReference.NULL_MESSAGE) {
                             nodeDest.getDestinationStatistics().getDispatched().increment();
                             nodeDest.getDestinationStatistics().getInflight().increment();
-                            if (LOG.isTraceEnabled()) {
-                                LOG.trace(info.getConsumerId() + " failed to dispatch: " + message.getMessageId() + " - "
-                                        + message.getDestination()  + ", dispatched: " + dispatchCounter + ", inflight: " + dispatched.size());
-                            }
+                            LOG.trace("{} failed to dispatch: {} - {}, dispatched: {}, inflight: {}", new Object[]{ info.getConsumerId(), message.getMessageId(), message.getDestination(), dispatchCounter, dispatched.size() });
                         }
                     }
                 }
@@ -753,10 +746,7 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
             if (node != QueueMessageReference.NULL_MESSAGE) {
                 nodeDest.getDestinationStatistics().getDispatched().increment();
                 nodeDest.getDestinationStatistics().getInflight().increment();
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace(info.getConsumerId() + " dispatched: " + message.getMessageId() + " - "
-                            + message.getDestination()  + ", dispatched: " + dispatchCounter + ", inflight: " + dispatched.size());
-                }
+                LOG.trace("{} dispatched: {} - {}, dispatched: {}, inflight: {}", new Object[]{ info.getConsumerId(), message.getMessageId(), message.getDestination(), dispatchCounter, dispatched.size() });
             }
         }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
index 74d7686..27ea50d 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
@@ -206,9 +206,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                     }
                 }
             } catch (InterruptedException e) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
-                }
+                LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
             }
         }
     };
@@ -274,10 +272,8 @@ public class Queue extends BaseDestination implements Task, UsageListener {
         @Override
         public boolean recoverMessage(Message message) {
             recoveredAccumulator++;
-            if (LOG.isInfoEnabled() && (recoveredAccumulator % 10000) == 0) {
-                LOG.info("cursor for " + getActiveMQDestination().getQualifiedName() + " has recovered "
-                        + recoveredAccumulator + " messages. " +
-                        (int) (recoveredAccumulator * 100 / totalMessageCount) + "% complete");
+            if ((recoveredAccumulator % 10000) == 0) {
+                LOG.info("cursor for {} has recovered {} messages. {}% complete", new Object[]{ getActiveMQDestination().getQualifiedName(), recoveredAccumulator, new Integer((int) (recoveredAccumulator * 100 / totalMessageCount))});
             }
             // Message could have expired while it was being
             // loaded..
@@ -428,12 +424,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
 
     @Override
     public void addSubscription(ConnectionContext context, Subscription sub) throws Exception {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(getActiveMQDestination().getQualifiedName() + " add sub: " + sub + ", dequeues: "
-                    + getDestinationStatistics().getDequeues().getCount() + ", dispatched: "
-                    + getDestinationStatistics().getDispatched().getCount() + ", inflight: "
-                    + getDestinationStatistics().getInflight().getCount());
-        }
+        LOG.debug("{} add sub: {}, dequeues: {}, dispatched: {}, inflight: {}", new Object[]{ getActiveMQDestination().getQualifiedName(), getDestinationStatistics().getDequeues().getCount(), getDestinationStatistics().getDispatched().getCount(), getDestinationStatistics().getInflight().getCount() });
 
         super.addSubscription(context, sub);
         // synchronize with dispatch method so that no new messages are sent
@@ -504,12 +495,14 @@ public class Queue extends BaseDestination implements Task, UsageListener {
         // while removing up a subscription.
         pagedInPendingDispatchLock.writeLock().lock();
         try {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug(getActiveMQDestination().getQualifiedName() + " remove sub: " + sub + ", lastDeliveredSeqId: " + lastDeiveredSequenceId + ", dequeues: "
-                        + getDestinationStatistics().getDequeues().getCount() + ", dispatched: "
-                        + getDestinationStatistics().getDispatched().getCount() + ", inflight: "
-                        + getDestinationStatistics().getInflight().getCount());
-            }
+            LOG.debug("{} remove sub: {}, lastDeliveredSeqId: {}, dequeues: {}, dispatched: {}, inflight: {}", new Object[]{
+                    getActiveMQDestination().getQualifiedName(),
+                    sub,
+                    lastDeiveredSequenceId,
+                    getDestinationStatistics().getDequeues().getCount(),
+                    getDestinationStatistics().getDispatched().getCount(),
+                    getDestinationStatistics().getInflight().getCount()
+            });
             consumersLock.writeLock().lock();
             try {
                 removeFromConsumerList(sub);
@@ -553,9 +546,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                         if (ref.getMessageId().getBrokerSequenceId() == lastDeiveredSequenceId) {
                             lastDeliveredRef = ref;
                             markAsRedelivered = true;
-                            if (LOG.isDebugEnabled()) {
-                                LOG.debug("found lastDeliveredSeqID: " + lastDeiveredSequenceId + ", message reference: " + ref.getMessageId());
-                            }
+                            LOG.debug("found lastDeliveredSeqID: {}, message reference: {}", lastDeiveredSequenceId, ref.getMessageId());
                             break;
                         }
                     }
@@ -615,7 +606,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
         message.setRegionDestination(this);
         ProducerState state = producerExchange.getProducerState();
         if (state == null) {
-            LOG.warn("Send failed for: " + message + ",  missing producer state for: " + producerExchange);
+            LOG.warn("Send failed for: {}, missing producer state for: {}", message, producerExchange);
             throw new JMSException("Cannot send message to " + getActiveMQDestination() + " with invalid (null) producer state");
         }
         final ProducerInfo producerInfo = producerExchange.getProducerState().getInfo();
@@ -636,12 +627,8 @@ public class Queue extends BaseDestination implements Task, UsageListener {
             if (isProducerFlowControl() && context.isProducerFlowControl()) {
                 if (warnOnProducerFlowControl) {
                     warnOnProducerFlowControl = false;
-                    LOG.info("Usage Manager Memory Limit ("
-                             + memoryUsage.getLimit()
-                             + ") reached on "
-                             + getActiveMQDestination().getQualifiedName()
-                             + ". Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it."
-                             + " See http://activemq.apache.org/producer-flow-control.html for more info");
+                    LOG.info("Usage Manager Memory Limit ({}) reached on {}. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info.",
+                                    memoryUsage.getLimit(), getActiveMQDestination().getQualifiedName());
                 }
 
                 if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) {
@@ -697,7 +684,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                                         response.setCorrelationId(message.getCommandId());
                                         context.getConnection().dispatchAsync(response);
                                     } else {
-                                        LOG.debug("unexpected exception on deferred send of :" + message, e);
+                                        LOG.debug("unexpected exception on deferred send of: {}", message, e);
                                     }
                                 }
                             }
@@ -725,9 +712,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                     // The usage manager could have delayed us by the time
                     // we unblock the message could have expired..
                     if (message.isExpired()) {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Expired message: " + message);
-                        }
+                        LOG.debug("Expired message: {}", message);
                         broker.getRoot().messageExpired(context, message, null);
                         return;
                     }
@@ -935,17 +920,13 @@ public class Queue extends BaseDestination implements Task, UsageListener {
     }
 
     private void expireMessages() {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(getActiveMQDestination().getQualifiedName() + " expiring messages ..");
-        }
+        LOG.debug("{} expiring messages ..", getActiveMQDestination().getQualifiedName());
 
         // just track the insertion count
         List<Message> browsedMessages = new InsertionCountList<Message>();
         doBrowse(browsedMessages, this.getMaxExpirePageSize());
         asyncWakeup();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(getActiveMQDestination().getQualifiedName() + " expiring messages done.");
-        }
+        LOG.debug("{} expiring messages done.", getActiveMQDestination().getQualifiedName());
     }
 
     @Override
@@ -1143,9 +1124,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                 for (MessageReference ref : toExpire) {
                     pagedInPendingDispatch.remove(ref);
                     if (broker.isExpired(ref)) {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("expiring from pagedInPending: " + ref);
-                        }
+                        LOG.debug("expiring from pagedInPending: {}", ref);
                         messageExpired(connectionContext, ref);
                     }
                 }
@@ -1161,9 +1140,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
             }
             for (MessageReference ref : toExpire) {
                 if (broker.isExpired(ref)) {
-                    if (LOG.isDebugEnabled()) {
-                        LOG.debug("expiring from pagedInMessages: " + ref);
-                    }
+                    LOG.debug("expiring from pagedInMessages: {}", ref);
                     messageExpired(connectionContext, ref);
                 } else {
                     pagedInMessagesLock.writeLock().lock();
@@ -1184,9 +1161,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                             MessageReference node = messages.next();
                             if (node.isExpired()) {
                                 if (broker.isExpired(node)) {
-                                    if (LOG.isDebugEnabled()) {
-                                        LOG.debug("expiring from messages: " + node);
-                                    }
+                                    LOG.debug("expiring from messages: {}", node);
                                     messageExpired(connectionContext, createMessageReference(node.getMessage()));
                                 }
                                 messages.remove();
@@ -1279,9 +1254,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
         } while (!list.isEmpty() && this.destinationStatistics.getMessages().getCount() > 0);
 
         if (this.destinationStatistics.getMessages().getCount() > 0) {
-            LOG.warn(getActiveMQDestination().getQualifiedName()
-                    + " after purge complete, message count stats report: "
-                    + this.destinationStatistics.getMessages().getCount());
+            LOG.warn("{} after purge complete, message count stats report: {}", getActiveMQDestination().getQualifiedName(), this.destinationStatistics.getMessages().getCount());
         }
         gc();
         this.destinationStatistics.getMessages().setCount(0);
@@ -1590,21 +1563,14 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                             timeout = timeBeforeDispatchStarts;
                         }
                         if (consumersBeforeStartsLatch.await(timeout, TimeUnit.MILLISECONDS)) {
-                            if (LOG.isDebugEnabled()) {
-                                LOG.debug(consumers.size() + " consumers subscribed. Starting dispatch.");
-                            }
+                            LOG.debug("{} consumers subscribed. Starting dispatch.", consumers.size());
                         } else {
-                            if (LOG.isDebugEnabled()) {
-                                LOG.debug(timeout + " ms elapsed and " + consumers.size()
-                                        + " consumers subscribed. Starting dispatch.");
-                            }
+                            LOG.debug("{} ms elapsed and {} consumers subscribed. Starting dispatch.", timeout, consumers.size());
                         }
                     }
                     if (timeBeforeDispatchStarts > 0 && consumersBeforeDispatchStarts <= 0) {
                         iteratingMutex.wait(timeBeforeDispatchStarts);
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug(timeBeforeDispatchStarts + " ms elapsed. Starting dispatch.");
-                        }
+                        LOG.debug("{} ms elapsed. Starting dispatch.", timeBeforeDispatchStarts);
                     }
                 } catch (Exception e) {
                     LOG.error(e.toString());
@@ -1658,10 +1624,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
 
                         QueueBrowserSubscription browser = browserDispatch.getBrowser();
 
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("dispatch to browser: " + browser
-                                    + ", already dispatched/paged count: " + alreadyDispatchedMessages.size());
-                        }
+                        LOG.debug("dispatch to browser: {}, already dispatched/paged count: {}", browser, alreadyDispatchedMessages.size());
                         boolean added = false;
                         for (QueueMessageReference node : alreadyDispatchedMessages) {
                             if (!node.isAcked() && !browser.isDuplicate(node.getMessageId())) {
@@ -1678,7 +1641,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
                             browserDispatches.remove(browserDispatch);
                         }
                     } catch (Exception e) {
-                        LOG.warn("exception on dispatch to browser: " + browserDispatch.getBrowser(), e);
+                        LOG.warn("exception on dispatch to browser: {}", browserDispatch.getBrowser(), e);
                     }
                 }
             }
@@ -1814,9 +1777,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
 
     @Override
     public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("message expired: " + reference);
-        }
+        LOG.debug("message expired: {}", reference);
         broker.messageExpired(context, reference, subs);
         destinationStatistics.getExpired().increment();
         try {
@@ -1854,9 +1815,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
         }finally {
             consumersLock.readLock().unlock();
         }
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(broker.getBrokerName() + " Message " + msg.getMessageId() + " sent to " + this.destination);
-        }
+        LOG.debug("{} Message {} sent to {}", new Object[]{ broker.getBrokerName(), msg.getMessageId(), this.destination });
         wakeup();
     }
 
@@ -1907,13 +1866,15 @@ public class Queue extends BaseDestination implements Task, UsageListener {
         PendingList resultList = null;
 
         int toPageIn = Math.min(getMaxPageSize(), messages.size());
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(destination.getPhysicalName() + " toPageIn: " + toPageIn + ", Inflight: "
-                    + destinationStatistics.getInflight().getCount() + ", pagedInMessages.size "
-                    + pagedInMessages.size() + ", enqueueCount: " + destinationStatistics.getEnqueues().getCount()
-                    + ", dequeueCount: " + destinationStatistics.getDequeues().getCount());
-        }
-
+        LOG.debug("{} toPageIn: {}, Inflight: {}, pagedInMessages.size {}, enqueueCount: {}, dequeueCount: {}",
+                new Object[]{
+                        destination.getPhysicalName(),
+                        toPageIn,
+                        destinationStatistics.getInflight().getCount(),
+                        pagedInMessages.size(),
+                        destinationStatistics.getEnqueues().getCount(),
+                        destinationStatistics.getDequeues().getCount()
+                });
         if (isLazyDispatch() && !force) {
             // Only page in the minimum number of messages which can be
             // dispatched immediately.
@@ -2153,7 +2114,7 @@ public class Queue extends BaseDestination implements Task, UsageListener {
             try {
                 activeMessage.setBooleanProperty("JMSXGroupFirstForConsumer", true, false);
             } catch (JMSException e) {
-                LOG.warn("Failed to set boolean header: " + e, e);
+                LOG.warn("Failed to set boolean header", e);
             }
         }
         subs.getConsumerInfo().setLastDeliveredSequenceId(subs.getConsumerInfo().getLastDeliveredSequenceId() + 1);

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java
index 4996eaa..e77714f 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/QueueSubscription.java
@@ -56,9 +56,7 @@ public class QueueSubscription extends PrefetchSubscription implements LockOwner
         if (n.isExpired()) {
             // sync with message expiry processing
             if (!broker.isExpired(n)) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("ignoring ack {}, for already expired message: {}", ack, n);
-                }
+                LOG.debug("ignoring ack {}, for already expired message: {}", ack, n);
                 return;
             }
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
index 65634b7..108670a 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
@@ -234,10 +234,10 @@ public class RegionBroker extends EmptyBroker {
                 if (context.isAllowLinkStealing()){
                      clientIdSet.remove(clientId);
                      if (oldContext.getConnection() != null) {
-                        LOG.warn("Stealing link for clientId " + clientId + " From Connection " + oldContext.getConnection());
+                        LOG.warn("Stealing link for clientId {} From Connection {}", clientId, oldContext.getConnection());
                         oldContext.getConnection().stop();
                      }else{
-                         LOG.error("Not Connection for " + oldContext);
+                         LOG.error("Not Connection for {}", oldContext);
                      }
                 }else{
                     throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from "
@@ -560,9 +560,7 @@ public class RegionBroker extends EmptyBroker {
             brokerInfos.put(info.getBrokerId(), existing);
         }
         existing.incrementRefCount();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(getBrokerName() + " addBroker:" + info.getBrokerName() + " brokerInfo size : " + brokerInfos.size());
-        }
+        LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() });
         addBrokerInClusterUpdate(info);
     }
 
@@ -573,9 +571,7 @@ public class RegionBroker extends EmptyBroker {
             if (existing != null && existing.decrementRefCount() == 0) {
                 brokerInfos.remove(info.getBrokerId());
             }
-            if (LOG.isDebugEnabled()) {
-                LOG.debug(getBrokerName() + " removeBroker:" + info.getBrokerName() + " brokerInfo size : " + brokerInfos.size());
-            }
+            LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()});
             // When stopping don't send cluster updates since we are the one's tearing down
             // our own bridges.
             if (!brokerService.isStopping()) {
@@ -688,7 +684,7 @@ public class RegionBroker extends EmptyBroker {
                     expired = stampAsExpired(message);
                 }
             } catch (IOException e) {
-                LOG.warn("unexpected exception on message expiry determination for: " + messageReference, e);
+                LOG.warn("unexpected exception on message expiry determination for: {}", messageReference, e);
             }
         }
         return expired;
@@ -706,9 +702,7 @@ public class RegionBroker extends EmptyBroker {
 
     @Override
     public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Message expired " + node);
-        }
+        LOG.debug("Message expired {}", node);
         getRoot().sendToDeadLetterQueue(context, node, subscription, new Throwable("Message Expired. Expiration:" + node.getExpiration()));
     }
 
@@ -745,15 +739,12 @@ public class RegionBroker extends EmptyBroker {
                             return true;
                         }
                     } else {
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Dead Letter message with no DLQ strategy in place, message id: " + message.getMessageId() + ", destination: "
-                                + message.getDestination());
-                        }
+                        LOG.debug("Dead Letter message with no DLQ strategy in place, message id: {}, destination: {}", message.getMessageId(), message.getDestination());
                     }
                 }
             }
         } catch (Exception e) {
-            LOG.warn("Caught an exception sending to DLQ: " + node, e);
+            LOG.warn("Caught an exception sending to DLQ: {}", node, e);
         }
 
         return false;
@@ -764,7 +755,7 @@ public class RegionBroker extends EmptyBroker {
         try {
             return getBrokerService().getBroker();
         } catch (Exception e) {
-            LOG.error("Trying to get Root Broker " + e);
+            LOG.error("Trying to get Root Broker", e);
             throw new RuntimeException("The broker from the BrokerService should not throw an exception");
         }
     }
@@ -795,7 +786,7 @@ public class RegionBroker extends EmptyBroker {
         try {
             getRegion(destination).processConsumerControl(consumerExchange, control);
         } catch (JMSException jmse) {
-            LOG.warn("unmatched destination: " + destination + ", in consumerControl: " + control);
+            LOG.warn("unmatched destination: {}, in consumerControl: {}", destination, control);
         }
     }
 
@@ -849,11 +840,11 @@ public class RegionBroker extends EmptyBroker {
                     if (dest instanceof BaseDestination) {
                         log = ((BaseDestination) dest).getLog();
                     }
-                    log.info(dest.getName() + " Inactive for longer than " + dest.getInactiveTimoutBeforeGC() + " ms - removing ...");
+                    log.info("{} Inactive for longer than {} ms - removing ...", dest.getName(), dest.getInactiveTimoutBeforeGC());
                     try {
                         getRoot().removeDestination(context, dest.getActiveMQDestination(), isAllowTempAutoCreationOnSend() ? 1 : 0);
                     } catch (Exception e) {
-                        LOG.error("Failed to remove inactive destination " + dest, e);
+                        LOG.error("Failed to remove inactive destination {}", dest, e);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueue.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueue.java
index aa0315d..8138277 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueue.java
@@ -76,9 +76,7 @@ public class TempQueue extends Queue{
                                         .getConnectionId()))) {
 
             tempDest.setConnectionId(sub.getConsumerInfo().getConsumerId().getConnectionId());
-            if (LOG.isDebugEnabled()) {
-                LOG.debug(" changed ownership of " + this + " to "+ tempDest.getConnectionId());
-            }
+            LOG.debug("changed ownership of {} to {}", this, tempDest.getConnectionId());
         }
         super.addSubscription(context, sub);
     }
@@ -86,15 +84,13 @@ public class TempQueue extends Queue{
     @Override
     public void dispose(ConnectionContext context) throws IOException {
         if (this.destinationStatistics.getMessages().getCount() > 0) {
-            LOG.info(getActiveMQDestination().getQualifiedName()
-                            + " on dispose, purge of "
-                            + this.destinationStatistics.getMessages().getCount() + " pending messages: " + messages);
+            LOG.info("{} on dispose, purge of {} pending messages: {}", new Object[]{ getActiveMQDestination().getQualifiedName(), this.destinationStatistics.getMessages().getCount(), messages });
             // we may want to capture these message ids in an advisory
         }
         try {
-           purge();
+            purge();
         } catch (Exception e) {
-          LOG.warn("Caught an exception purging Queue: " + destination);
+            LOG.warn("Caught an exception purging Queue: {}", destination, e);
         }
         super.dispose(context);
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueueRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueueRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueueRegion.java
index 75a6d6c..78d6955 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueueRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempQueueRegion.java
@@ -18,16 +18,12 @@ package org.apache.activemq.broker.region;
 
 import javax.jms.JMSException;
 
-import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.ConnectionContext;
-import org.apache.activemq.broker.region.policy.PolicyEntry;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.command.MessageDispatchNotification;
 import org.apache.activemq.thread.TaskRunnerFactory;
 import org.apache.activemq.usage.SystemUsage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * 

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java
index e1ffd05..bc0f8a9 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TempTopicRegion.java
@@ -21,7 +21,6 @@ import javax.jms.JMSException;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.policy.PolicyEntry;
 import org.apache.activemq.command.ActiveMQDestination;
-import org.apache.activemq.command.ActiveMQTempTopic;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.thread.TaskRunnerFactory;
 import org.apache.activemq.usage.SystemUsage;

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
index ebb6dfa..328410c 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java
@@ -272,7 +272,7 @@ public class Topic extends BaseDestination implements Task {
                                 subscription.add(message);
                             }
                         } catch (IOException e) {
-                            LOG.error("Failed to recover this message " + message);
+                            LOG.error("Failed to recover this message {}", message, e);
                         }
                         return true;
                     }
@@ -340,10 +340,7 @@ public class Topic extends BaseDestination implements Task {
 
                 if (warnOnProducerFlowControl) {
                     warnOnProducerFlowControl = false;
-                    LOG.info(memoryUsage + ", Usage Manager memory limit reached for "
-                                    + getActiveMQDestination().getQualifiedName()
-                                    + ". Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it."
-                                    + " See http://activemq.apache.org/producer-flow-control.html for more info");
+                    LOG.info("{}, Usage Manager memory limit reached for {}. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info.", getActiveMQDestination().getQualifiedName());
                 }
 
                 if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) {
@@ -411,8 +408,7 @@ public class Topic extends BaseDestination implements Task {
                                 if (count > 2 && context.isInTransaction()) {
                                     count = 0;
                                     int size = context.getTransaction().size();
-                                    LOG.warn("Waiting for space to send  transacted message - transaction elements = "
-                                            + size + " need more space to commit. Message = " + message);
+                                    LOG.warn("Waiting for space to send transacted message - transaction elements = {} need more space to commit. Message = {}", size, message);
                                 }
                                 count++;
                             }
@@ -434,9 +430,7 @@ public class Topic extends BaseDestination implements Task {
                     // we unblock the message could have expired..
                     if (message.isExpired()) {
                         getDestinationStatistics().getExpired().increment();
-                        if (LOG.isDebugEnabled()) {
-                            LOG.debug("Expired message: " + message);
-                        }
+                        LOG.debug("Expired message: {}", message);
                         return;
                     }
                 }
@@ -632,7 +626,7 @@ public class Topic extends BaseDestination implements Task {
                 }
             }
         } catch (Throwable e) {
-            LOG.warn("Failed to browse Topic: " + getActiveMQDestination().getPhysicalName(), e);
+            LOG.warn("Failed to browse Topic: {}", getActiveMQDestination().getPhysicalName(), e);
         }
     }
 
@@ -802,9 +796,10 @@ public class Topic extends BaseDestination implements Task {
             try {
                 durableTopicSubscription.dispatchPending();
             } catch (IOException exception) {
-                LOG.warn("After clear of pending, failed to dispatch to: " +
-                        durableTopicSubscription + ", for :" + destination + ", pending: " +
-                        durableTopicSubscription.pending, exception);
+                LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{
+                        durableTopicSubscription,
+                        destination,
+                        durableTopicSubscription.pending }, exception);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
index 92fb83b..27e1d28 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicRegion.java
@@ -89,7 +89,7 @@ public class TopicRegion extends AbstractRegion {
             if (!sub.isActive()) {
                 long offline = sub.getOfflineTimestamp();
                 if (offline != -1 && now - offline >= broker.getBrokerService().getOfflineDurableSubscriberTimeout()) {
-                    LOG.info("Destroying durable subscriber due to inactivity: " + sub);
+                    LOG.info("Destroying durable subscriber due to inactivity: {}", sub);
                     try {
                         RemoveSubscriptionInfo info = new RemoveSubscriptionInfo();
                         info.setClientId(entry.getKey().getClientId());
@@ -231,9 +231,7 @@ public class TopicRegion extends AbstractRegion {
             for (int i = 0; i < infos.length; i++) {
 
                 SubscriptionInfo info = infos[i];
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Restoring durable subscription: " + info);
-                }
+                LOG.debug("Restoring durable subscription: {}", info);
                 SubscriptionKey key = new SubscriptionKey(info);
 
                 // A single durable sub may be subscribing to multiple topics.

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
index e369822..7e17cf3 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/TopicSubscription.java
@@ -115,7 +115,7 @@ public class TopicSubscription extends AbstractSubscription {
             if (info.getPrefetchSize() > 1 && matched.size() > info.getPrefetchSize()) {
                 // Slow consumers should log and set their state as such.
                 if (!isSlowConsumer()) {
-                    LOG.warn(toString() + ": has twice its prefetch limit pending, without an ack; it appears to be slow");
+                    LOG.warn("{}: has twice its prefetch limit pending, without an ack; it appears to be slow", toString());
                     setSlowConsumer(true);
                     for (Destination dest: destinations) {
                         dest.slowConsumer(getContext(), this);
@@ -128,18 +128,18 @@ public class TopicSubscription extends AbstractSubscription {
                     synchronized (matchedListMutex) {
                         while (matched.isFull()) {
                             if (getContext().getStopping().get()) {
-                                LOG.warn(toString() + ": stopped waiting for space in pendingMessage cursor for: "
-                                        + node.getMessageId());
+                                LOG.warn("{}: stopped waiting for space in pendingMessage cursor for: {}", toString(), node.getMessageId());
                                 enqueueCounter.decrementAndGet();
                                 return;
                             }
                             if (!warnedAboutWait) {
-                                LOG.info(toString() + ": Pending message cursor [" + matched
-                                        + "] is full, temp usage ("
-                                        + +matched.getSystemUsage().getTempUsage().getPercentUsage()
-                                        + "%) or memory usage ("
-                                        + matched.getSystemUsage().getMemoryUsage().getPercentUsage()
-                                        + "%) limit reached, blocking message add() pending the release of resources.");
+                                LOG.info("{}: Pending message cursor [{}] is full, temp usag ({}%) or memory usage ({}%) limit reached, blocking message add() pending the release of resources.",
+                                        new Object[]{
+                                                toString(),
+                                                matched,
+                                                matched.getSystemUsage().getTempUsage().getPercentUsage(),
+                                                matched.getSystemUsage().getMemoryUsage().getPercentUsage()
+                                        });
                                 warnedAboutWait = true;
                             }
                             matchedListMutex.wait(20);
@@ -188,7 +188,9 @@ public class TopicSubscription extends AbstractSubscription {
                             // lets avoid an infinite loop if we are given a bad eviction strategy
                             // for a bad strategy lets just not evict
                             if (messagesToEvict == 0) {
-                                LOG.warn("No messages to evict returned for "  + destination + " from eviction strategy: " + messageEvictionStrategy + " out of " + list.size() + " candidates");
+                                LOG.warn("No messages to evict returned for {} from eviction strategy: {} out of {} candidates", new Object[]{
+                                        destination, messageEvictionStrategy, list.size()
+                                });
                                 break;
                             }
                         }
@@ -205,7 +207,7 @@ public class TopicSubscription extends AbstractSubscription {
             duplicate = audit.isDuplicate(node);
             if (LOG.isDebugEnabled()) {
                 if (duplicate) {
-                    LOG.debug(this + ", ignoring duplicate add: " + node.getMessageId());
+                    LOG.debug("{}, ignoring duplicate add: {}", this, node.getMessageId());
                 }
             }
         }
@@ -623,9 +625,7 @@ public class TopicSubscription extends AbstractSubscription {
         if(destination != null) {
             destination.getDestinationStatistics().getDequeues().increment();
         }
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(this + ", discarding message " + message);
-        }
+        LOG.debug("{}, discarding message {}", this, message);
         Destination dest = (Destination) message.getRegionDestination();
         if (dest != null) {
             dest.messageDiscarded(getContext(), this, message);

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
index c04a302..624c4f3 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
@@ -96,9 +96,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
              * the cache. If subsequently, we pull out that message from the store (before its deleted)
              * it will be a duplicate - but should be ignored
              */
-            if (LOG.isTraceEnabled()) {
-                LOG.trace(this + " - cursor got duplicate: " + message.getMessageId() + ", " + message.getPriority());
-            }
+            LOG.trace("{} - cursor got duplicate: {}, {}", new Object[]{ this, message.getMessageId(), message.getPriority() });
         }
         return recovered;
     }
@@ -109,7 +107,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
             try {
                 fillBatch();
             } catch (Exception e) {
-                LOG.error(this + " - Failed to fill batch", e);
+                LOG.error("{} - Failed to fill batch", this, e);
                 throw new RuntimeException(e);
             }
         }
@@ -146,7 +144,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
             try {
                 fillBatch();
             } catch (Exception e) {
-                LOG.error(this + " - Failed to fill batch", e);
+                LOG.error("{} - Failed to fill batch", this, e);
                 throw new RuntimeException(e);
             }
         }
@@ -172,9 +170,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
         boolean disableCache = false;
         if (hasSpace()) {
             if (!isCacheEnabled() && size==0 && isStarted() && useCache) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace(this + " - enabling cache for empty store " + node.getMessageId());
-                }
+                LOG.trace("{} - enabling cache for empty store {}", this, node.getMessageId());
                 setCacheEnabled(true);
             }
             if (isCacheEnabled()) {
@@ -194,11 +190,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
             setCacheEnabled(false);
             // sync with store on disabling the cache
             if (lastCachedId != null) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace(this + " - disabling cache"
-                            + ", lastCachedId: " + lastCachedId
-                            + " current node Id: " + node.getMessageId() + " batchList size: " + batchList.size());
-                }
+                LOG.trace(this + "{} - disabling cache, lastCachedId: {} current node Id: {} batchList size: {}", new Object[]{ this, lastCachedId, node.getMessageId(), batchList.size() });
                 setBatch(lastCachedId);
                 lastCachedId = null;
             }
@@ -254,9 +246,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
     }
 
     protected final synchronized void fillBatch() {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace(this + " - fillBatch");
-        }
+        LOG.trace("{} - fillBatch", this);
         if (batchResetNeeded) {
             resetSize();
             setMaxBatchSize(Math.min(regionDestination.getMaxPageSize(), size));
@@ -267,7 +257,7 @@ public abstract class AbstractStoreCursor extends AbstractPendingMessageCursor i
             try {
                 doFillBatch();
             } catch (Exception e) {
-                LOG.error(this + " - Failed to fill batch", e);
+                LOG.error("{} - Failed to fill batch", this, e);
                 throw new RuntimeException(e);
             }
             this.storeHasMessages = !this.batchList.isEmpty() || !hadSpace;

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java
index f85a04a..b1767e3 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/FilePendingMessageCursor.java
@@ -240,7 +240,7 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
                 return false;
 
             } catch (Exception e) {
-                LOG.error("Caught an Exception adding a message: " + node + " first to FilePendingMessageCursor ", e);
+                LOG.error("Caught an Exception adding a message: {} first to FilePendingMessageCursor ", node, e);
                 throw new RuntimeException(e);
             }
         } else {
@@ -287,7 +287,7 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
                 node.getMessageId().setPlistLocator(locator);
 
             } catch (Exception e) {
-                LOG.error("Caught an Exception adding a message: " + node + " first to FilePendingMessageCursor ", e);
+                LOG.error("Caught an Exception adding a message: {} first to FilePendingMessageCursor ", node, e);
                 throw new RuntimeException(e);
             }
         } else {
@@ -433,7 +433,7 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
             long start = 0;
              if (LOG.isTraceEnabled()) {
                 start = System.currentTimeMillis();
-                LOG.trace("" + name + ", flushToDisk() mem list size: " +memoryList.size()  + " " +  (systemUsage != null ? systemUsage.getMemoryUsage() : "") );
+                LOG.trace("{}, flushToDisk() mem list size: {} {}", new Object[]{ name, memoryList.size(), (systemUsage != null ? systemUsage.getMemoryUsage() : "") });
              }
             for (Iterator<MessageReference> iterator = memoryList.iterator(); iterator.hasNext();) {
                 MessageReference node = iterator.next();
@@ -450,9 +450,7 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
             }
             memoryList.clear();
             setCacheEnabled(false);
-             if (LOG.isTraceEnabled()) {
-                LOG.trace("" + name + ", flushToDisk() done - " + (System.currentTimeMillis() - start) + "ms " + (systemUsage != null ? systemUsage.getMemoryUsage() : ""));
-             }
+            LOG.trace("{}, flushToDisk() done - {} ms {}", new Object[]{ name, (System.currentTimeMillis() - start), (systemUsage != null ? systemUsage.getMemoryUsage() : "") });
         }
     }
 
@@ -465,7 +463,7 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
             try {
                 diskList = store.getPList(name);
             } catch (Exception e) {
-                LOG.error("Caught an IO Exception getting the DiskList " + name, e);
+                LOG.error("Caught an IO Exception getting the DiskList {}", name, e);
                 throw new RuntimeException(e);
             }
         }
@@ -473,9 +471,7 @@ public class FilePendingMessageCursor extends AbstractPendingMessageCursor imple
     }
 
     private void discardExpiredMessage(MessageReference reference) {
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Discarding expired message " + reference);
-        }
+        LOG.debug("Discarding expired message {}", reference);
         if (broker.isExpired(reference)) {
             ConnectionContext context = new ConnectionContext(new NonCachedMessageEvaluationContext());
             context.setBroker(broker);

http://git-wip-us.apache.org/repos/asf/activemq/blob/e1bbde73/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java
index 89e5647..6d03eeb 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java
@@ -199,11 +199,7 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor {
                     if (prioritizedMessages && immediatePriorityDispatch && tsp.isPaging()) {
                         if (msg.getPriority() > tsp.getLastRecoveredPriority()) {
                             tsp.recoverMessage(node.getMessage(), true);
-                            if (LOG.isTraceEnabled()) {
-                                LOG.trace("cached high priority (" + msg.getPriority() + ") message:" +
-                                    msg.getMessageId() + ", current paged batch priority: " +
-                                    tsp.getLastRecoveredPriority() + ", cache size:" + tsp.batchList.size());
-                            }
+                            LOG.trace("cached high priority ({} message: {}, current paged batch priority: {}, cache size: {}", new Object[]{ msg.getPriority(), msg.getMessageId(), tsp.getLastRecoveredPriority(), tsp.batchList.size()});
                         }
                     }
                 }


Mime
View raw message