From 4443d32e5d48bc8dbc4c1763697b9f96dd6c5200 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Wed, 14 Mar 2007 15:45:16 +0000 Subject: [PATCH] tidied up the logging to reduce clutter & make it easier for users to see the URLs they can click on git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@518191 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/web/MessageServletSupport.java | 12 +++++++++--- .../main/java/org/apache/activemq/web/WebClient.java | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java b/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java index 8fdf83d855..e4a455d51e 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java @@ -21,6 +21,8 @@ package org.apache.activemq.web; import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.jms.Destination; import javax.jms.JMSException; @@ -49,6 +51,8 @@ import java.util.Map; */ public abstract class MessageServletSupport extends HttpServlet { + private static final transient Log log = LogFactory.getLog(MessageServletSupport.class); + private boolean defaultTopicFlag = true; private Destination defaultDestination; private String destinationParameter = "destination"; @@ -69,7 +73,9 @@ public abstract class MessageServletSupport extends HttpServlet { defaultTopicFlag = asBoolean(name); } - log("Defaulting to use topics: " + defaultTopicFlag); + if (log.isDebugEnabled()) { + log.debug("Defaulting to use topics: " + defaultTopicFlag); + } name = servletConfig.getInitParameter("destination"); if (name != null) { @@ -137,10 +143,10 @@ public abstract class MessageServletSupport extends HttpServlet { value = array[0]; } else { - log("Can't use property: " + name + " which is of type: " + value.getClass().getName() + " value"); + log.warn("Can't use property: " + name + " which is of type: " + value.getClass().getName() + " value"); value = null; for (int i = 0, size = array.length; i < size; i++) { - log("value[" + i + "] = " + array[i]); + log.debug("value[" + i + "] = " + array[i]); } } } diff --git a/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java b/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java index 2564dce989..da51cc71dd 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java @@ -235,7 +235,8 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind if (factory == null) { String brokerURL = servletContext.getInitParameter(brokerUrlInitParam); - servletContext.log("Value of: " + brokerUrlInitParam + " is: " + brokerURL); + + log.debug("Value of: " + brokerUrlInitParam + " is: " + brokerURL); if (brokerURL == null) { brokerURL = "vm://localhost";