This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new e313ee8dc9 Differentiate trace and debug log levels e313ee8dc9 is described below commit e313ee8dc9132edc816f88f9d63409e29add5a09 Author: remm <r...@apache.org> AuthorDate: Tue Feb 6 10:11:26 2024 +0100 Differentiate trace and debug log levels --- java/org/apache/naming/SelectorContext.java | 32 ++++---- .../org/apache/tomcat/util/IntrospectionUtils.java | 21 +++-- .../util/descriptor/web/LocalStrings.properties | 1 + .../tomcat/util/descriptor/web/WebRuleSet.java | 40 +++++----- .../tomcat/util/digester/CallMethodRule.java | 4 +- .../apache/tomcat/util/digester/CallParamRule.java | 4 +- java/org/apache/tomcat/util/digester/Digester.java | 92 +++++++++++----------- .../tomcat/util/digester/FactoryCreateRule.java | 12 +-- .../tomcat/util/digester/ObjectCreateRule.java | 4 +- .../apache/tomcat/util/digester/SetNextRule.java | 6 +- .../tomcat/util/digester/SetPropertiesRule.java | 8 +- java/org/apache/tomcat/util/http/Parameters.java | 16 ++-- .../tomcat/util/http/Rfc6265CookieProcessor.java | 4 +- .../apache/tomcat/util/modeler/BaseModelMBean.java | 28 +++---- java/org/apache/tomcat/util/modeler/Registry.java | 16 ++-- .../MbeansDescriptorsIntrospectionSource.java | 24 +++--- .../org/apache/tomcat/util/threads/LimitLatch.java | 8 +- 17 files changed, 161 insertions(+), 159 deletions(-) diff --git a/java/org/apache/naming/SelectorContext.java b/java/org/apache/naming/SelectorContext.java index 66dee29777..3675b4e1e4 100644 --- a/java/org/apache/naming/SelectorContext.java +++ b/java/org/apache/naming/SelectorContext.java @@ -127,8 +127,8 @@ public class SelectorContext implements Context { public Object lookup(Name name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingName", "lookup", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingName", "lookup", name)); } @@ -150,8 +150,8 @@ public class SelectorContext implements Context { public Object lookup(String name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingString", "lookup", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingString", "lookup", name)); } @@ -327,8 +327,8 @@ public class SelectorContext implements Context { public NamingEnumeration<NameClassPair> list(Name name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingName", "list", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingName", "list", name)); } @@ -349,8 +349,8 @@ public class SelectorContext implements Context { public NamingEnumeration<NameClassPair> list(String name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingString", "list", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingString", "list", name)); } @@ -375,8 +375,8 @@ public class SelectorContext implements Context { public NamingEnumeration<Binding> listBindings(Name name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingName", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingName", "listBindings", name)); } @@ -397,8 +397,8 @@ public class SelectorContext implements Context { public NamingEnumeration<Binding> listBindings(String name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingString", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingString", "listBindings", name)); } @@ -507,8 +507,8 @@ public class SelectorContext implements Context { public Object lookupLink(Name name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingName", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingName", "lookupLink", name)); } @@ -529,8 +529,8 @@ public class SelectorContext implements Context { public Object lookupLink(String name) throws NamingException { - if (log.isDebugEnabled()) { - log.debug(sm.getString("selectorContext.methodUsingString", + if (log.isTraceEnabled()) { + log.trace(sm.getString("selectorContext.methodUsingString", "lookupLink", name)); } diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java b/java/org/apache/tomcat/util/IntrospectionUtils.java index ab4d533b10..6ac14f5eab 100644 --- a/java/org/apache/tomcat/util/IntrospectionUtils.java +++ b/java/org/apache/tomcat/util/IntrospectionUtils.java @@ -51,8 +51,8 @@ public final class IntrospectionUtils { @SuppressWarnings("null") // setPropertyMethodVoid is not null when used public static boolean setProperty(Object o, String name, String value, boolean invokeSetProperty) { - if (log.isDebugEnabled()) { - log.debug("IntrospectionUtils: setProperty(" + + if (log.isTraceEnabled()) { + log.trace("IntrospectionUtils: setProperty(" + o.getClass() + " " + name + "=" + value + ")"); } @@ -120,8 +120,8 @@ public final class IntrospectionUtils { // Unknown type } else { - if (log.isDebugEnabled()) { - log.debug("IntrospectionUtils: Unknown type " + + if (log.isTraceEnabled()) { + log.trace("IntrospectionUtils: Unknown type " + paramType.getName()); } } @@ -412,8 +412,8 @@ public final class IntrospectionUtils { "IntrospectionUtils: Assert: Illegal params " + target + " " + param1); } - if (log.isDebugEnabled()) { - log.debug("IntrospectionUtils: callMethod1 " + + if (log.isTraceEnabled()) { + log.trace("IntrospectionUtils: callMethod1 " + target.getClass().getName() + " " + param1.getClass().getName() + " " + typeParam1); } @@ -451,8 +451,7 @@ public final class IntrospectionUtils { try { Object o = m.invoke(target, params); - if (log.isDebugEnabled()) { - // debug + if (log.isTraceEnabled()) { StringBuilder sb = new StringBuilder(); sb.append(target.getClass().getName()).append('.').append(methodN).append('('); for (int i = 0; i < params.length; i++) { @@ -462,7 +461,7 @@ public final class IntrospectionUtils { sb.append(params[i]); } sb.append(')'); - log.debug("IntrospectionUtils:" + sb.toString()); + log.trace("IntrospectionUtils:" + sb.toString()); } return o; } catch (InvocationTargetException ie) { @@ -500,8 +499,8 @@ public final class IntrospectionUtils { // Unknown type } else { - if (log.isDebugEnabled()) { - log.debug("IntrospectionUtils: Unknown type " + + if (log.isTraceEnabled()) { + log.trace("IntrospectionUtils: Unknown type " + paramType.getName()); } } diff --git a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties index e3dda224ce..d9283f3300 100644 --- a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties +++ b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties @@ -25,6 +25,7 @@ servletDef.invalidServletName=Invalid <servlet-name> [{0}] in servlet definition webRuleSet.absoluteOrdering=<absolute-ordering> element not valid in web-fragment.xml and will be ignored webRuleSet.absoluteOrderingCount=<absolute-ordering> element is limited to 1 occurrence webRuleSet.nameCount=<name> element is limited to 1 occurrence +webRuleSet.noMethod=Cannot find method [{0}] in object [{1}] of class [{2}] webRuleSet.postconstruct.duplicate=Duplicate post construct method definition for class [{0}] webRuleSet.predestroy.duplicate=Duplicate @PreDestroy method definition for class [{0}] webRuleSet.relativeOrdering=<ordering> element not valid in web.xml and will be ignored diff --git a/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java b/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java index fcb92a32e5..a3072f3378 100644 --- a/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java +++ b/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java @@ -794,9 +794,9 @@ final class SetAuthConstraintRule extends Rule { SecurityConstraint securityConstraint = (SecurityConstraint) digester.peek(); securityConstraint.setAuthConstraint(true); - if (digester.getLogger().isDebugEnabled()) { + if (digester.getLogger().isTraceEnabled()) { digester.getLogger() - .debug("Calling SecurityConstraint.setAuthConstraint(true)"); + .trace("Calling SecurityConstraint.setAuthConstraint(true)"); } } @@ -818,8 +818,8 @@ final class SetDistributableRule extends Rule { throws Exception { WebXml webXml = (WebXml) digester.peek(); webXml.setDistributable(true); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace (webXml.getClass().getName() + ".setDistributable(true)"); } } @@ -841,8 +841,8 @@ final class SetDenyUncoveredHttpMethodsRule extends Rule { throws Exception { WebXml webXml = (WebXml) digester.peek(); webXml.setDenyUncoveredHttpMethods(true); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug(webXml.getClass().getName() + + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace(webXml.getClass().getName() + ".setDenyUncoveredHttpMethods(true)"); } } @@ -882,8 +882,8 @@ final class SetPublicIdRule extends Rule { } m.invoke(top, (Object [])paramValues); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug("" + top.getClass().getName() + "." + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace("" + top.getClass().getName() + "." + method + "(" + paramValues[0] + ")"); } @@ -908,8 +908,8 @@ final class ServletDefCreateRule extends Rule { throws Exception { ServletDef servletDef = new ServletDef(); digester.push(servletDef); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug("new " + servletDef.getClass().getName()); + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace("new " + servletDef.getClass().getName()); } } @@ -917,8 +917,8 @@ final class ServletDefCreateRule extends Rule { public void end(String namespace, String name) throws Exception { ServletDef servletDef = (ServletDef) digester.pop(); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug("pop " + servletDef.getClass().getName()); + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace("pop " + servletDef.getClass().getName()); } } @@ -1074,8 +1074,8 @@ final class IgnoreAnnotationsRule extends Rule { } else if ("false".equals(value)) { webxml.setMetadataComplete(false); } - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace (webxml.getClass().getName() + ".setMetadataComplete( " + webxml.isMetadataComplete() + ")"); } @@ -1100,8 +1100,8 @@ final class VersionRule extends Rule { WebXml webxml = (WebXml) digester.peek(digester.getCount() - 1); webxml.setVersion(attributes.getValue("version")); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace (webxml.getClass().getName() + ".setVersion( " + webxml.getVersion() + ")"); } @@ -1167,8 +1167,8 @@ final class AbsoluteOrderingRule extends Rule { isAbsoluteOrderingSet = true; WebXml webXml = (WebXml) digester.peek(); webXml.createAbsoluteOrdering(); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug( + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace( webXml.getClass().getName() + ".setAbsoluteOrdering()"); } } @@ -1374,8 +1374,8 @@ final class SetOverrideRule extends Rule { public void begin(String namespace, String name, Attributes attributes) throws Exception { ContextEnvironment envEntry = (ContextEnvironment) digester.peek(); envEntry.setOverride(false); - if (digester.getLogger().isDebugEnabled()) { - digester.getLogger().debug(envEntry.getClass().getName() + ".setOverride(false)"); + if (digester.getLogger().isTraceEnabled()) { + digester.getLogger().trace(envEntry.getClass().getName() + ".setOverride(false)"); } } } diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java b/java/org/apache/tomcat/util/digester/CallMethodRule.java index 7d78c997b5..640917d98e 100644 --- a/java/org/apache/tomcat/util/digester/CallMethodRule.java +++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java @@ -387,7 +387,7 @@ public class CallMethodRule extends Rule { } // Invoke the required method on the top object - if (digester.log.isDebugEnabled()) { + if (digester.log.isTraceEnabled()) { StringBuilder sb = new StringBuilder("[CallMethodRule]{"); sb.append(digester.match); sb.append("} Call "); @@ -412,7 +412,7 @@ public class CallMethodRule extends Rule { } } sb.append(')'); - digester.log.debug(sb.toString()); + digester.log.trace(sb.toString()); } Object result = IntrospectionUtils.callMethodN(target, methodName, paramValues, paramTypes); diff --git a/java/org/apache/tomcat/util/digester/CallParamRule.java b/java/org/apache/tomcat/util/digester/CallParamRule.java index 799318ca59..dd85acf266 100644 --- a/java/org/apache/tomcat/util/digester/CallParamRule.java +++ b/java/org/apache/tomcat/util/digester/CallParamRule.java @@ -125,13 +125,13 @@ public class CallParamRule extends Rule { param = digester.peek(stackIndex); - if (digester.log.isDebugEnabled()) { + if (digester.log.isTraceEnabled()) { StringBuilder sb = new StringBuilder("[CallParamRule]{"); sb.append(digester.match); sb.append("} Save from stack; from stack?").append(fromStack); sb.append("; object=").append(param); - digester.log.debug(sb.toString()); + digester.log.trace(sb.toString()); } } diff --git a/java/org/apache/tomcat/util/digester/Digester.java b/java/org/apache/tomcat/util/digester/Digester.java index b38a5461e6..96e9647760 100644 --- a/java/org/apache/tomcat/util/digester/Digester.java +++ b/java/org/apache/tomcat/util/digester/Digester.java @@ -874,8 +874,8 @@ public class Digester extends DefaultHandler2 { @Override public void characters(char buffer[], int start, int length) throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("characters(" + new String(buffer, start, length) + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("characters(" + new String(buffer, start, length) + ")"); } bodyText.append(buffer, start, length); @@ -891,11 +891,11 @@ public class Digester extends DefaultHandler2 { @Override public void endDocument() throws SAXException { - if (saxLog.isDebugEnabled()) { + if (saxLog.isTraceEnabled()) { if (getCount() > 1) { - saxLog.debug("endDocument(): " + getCount() + " elements left"); + saxLog.trace("endDocument(): " + getCount() + " elements left"); } else { - saxLog.debug("endDocument()"); + saxLog.trace("endDocument()"); } } @@ -938,14 +938,14 @@ public class Digester extends DefaultHandler2 { public void endElement(String namespaceURI, String localName, String qName) throws SAXException { - boolean debug = log.isDebugEnabled(); + boolean debug = log.isTraceEnabled(); if (debug) { if (saxLog.isDebugEnabled()) { - saxLog.debug("endElement(" + namespaceURI + "," + localName + "," + qName + ")"); + saxLog.trace("endElement(" + namespaceURI + "," + localName + "," + qName + ")"); } - log.debug(" match='" + match + "'"); - log.debug(" bodyText='" + bodyText + "'"); + log.trace(" match='" + match + "'"); + log.trace(" bodyText='" + bodyText + "'"); } // Parse system properties @@ -966,7 +966,7 @@ public class Digester extends DefaultHandler2 { try { Rule rule = value; if (debug) { - log.debug(" Fire body() for " + rule); + log.trace(" Fire body() for " + rule); } rule.body(namespaceURI, name, bodyText); } catch (Exception e) { @@ -979,7 +979,7 @@ public class Digester extends DefaultHandler2 { } } else { if (debug) { - log.debug(" No rules found matching '" + match + "'."); + log.trace(" No rules found matching '" + match + "'."); } if (rulesValidation) { log.warn(" No rules found matching '" + match + "'."); @@ -996,7 +996,7 @@ public class Digester extends DefaultHandler2 { try { Rule rule = rules.get(j); if (debug) { - log.debug(" Fire end() for " + rule); + log.trace(" Fire end() for " + rule); } rule.end(namespaceURI, name); } catch (Exception e) { @@ -1030,8 +1030,8 @@ public class Digester extends DefaultHandler2 { @Override public void endPrefixMapping(String prefix) throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("endPrefixMapping(" + prefix + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("endPrefixMapping(" + prefix + ")"); } // Deregister this prefix mapping @@ -1064,8 +1064,8 @@ public class Digester extends DefaultHandler2 { @Override public void ignorableWhitespace(char buffer[], int start, int len) throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("ignorableWhitespace(" + new String(buffer, start, len) + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("ignorableWhitespace(" + new String(buffer, start, len) + ")"); } // No processing required @@ -1084,8 +1084,8 @@ public class Digester extends DefaultHandler2 { @Override public void processingInstruction(String target, String data) throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("processingInstruction('" + target + "','" + data + "')"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("processingInstruction('" + target + "','" + data + "')"); } // No processing is required @@ -1112,8 +1112,8 @@ public class Digester extends DefaultHandler2 { @Override public void setDocumentLocator(Locator locator) { - if (saxLog.isDebugEnabled()) { - saxLog.debug("setDocumentLocator(" + locator + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("setDocumentLocator(" + locator + ")"); } this.locator = locator; @@ -1131,8 +1131,8 @@ public class Digester extends DefaultHandler2 { @Override public void skippedEntity(String name) throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("skippedEntity(" + name + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("skippedEntity(" + name + ")"); } // No processing required @@ -1149,8 +1149,8 @@ public class Digester extends DefaultHandler2 { @Override public void startDocument() throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("startDocument()"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("startDocument()"); } if (locator instanceof Locator2) { @@ -1191,10 +1191,10 @@ public class Digester extends DefaultHandler2 { @Override public void startElement(String namespaceURI, String localName, String qName, Attributes list) throws SAXException { - boolean debug = log.isDebugEnabled(); + boolean debug = log.isTraceEnabled(); - if (saxLog.isDebugEnabled()) { - saxLog.debug("startElement(" + namespaceURI + "," + localName + "," + qName + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("startElement(" + namespaceURI + "," + localName + "," + qName + ")"); } // Parse system properties @@ -1219,7 +1219,7 @@ public class Digester extends DefaultHandler2 { sb.append(name); match = sb.toString(); if (debug) { - log.debug(" New match='" + match + "'"); + log.trace(" New match='" + match + "'"); } // Fire "begin" events for all relevant rules @@ -1230,7 +1230,7 @@ public class Digester extends DefaultHandler2 { try { Rule rule = value; if (debug) { - log.debug(" Fire begin() for " + rule); + log.trace(" Fire begin() for " + rule); } rule.begin(namespaceURI, name, list); } catch (Exception e) { @@ -1243,7 +1243,7 @@ public class Digester extends DefaultHandler2 { } } else { if (debug) { - log.debug(" No rules found matching '" + match + "'."); + log.trace(" No rules found matching '" + match + "'."); } } @@ -1261,8 +1261,8 @@ public class Digester extends DefaultHandler2 { @Override public void startPrefixMapping(String prefix, String namespaceURI) throws SAXException { - if (saxLog.isDebugEnabled()) { - saxLog.debug("startPrefixMapping(" + prefix + "," + namespaceURI + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("startPrefixMapping(" + prefix + "," + namespaceURI + ")"); } // Register this prefix mapping @@ -1289,8 +1289,8 @@ public class Digester extends DefaultHandler2 { @Override public void notationDecl(String name, String publicId, String systemId) { - if (saxLog.isDebugEnabled()) { - saxLog.debug("notationDecl(" + name + "," + publicId + "," + systemId + ")"); + if (saxLog.isTraceEnabled()) { + saxLog.trace("notationDecl(" + name + "," + publicId + "," + systemId + ")"); } } @@ -1307,8 +1307,8 @@ public class Digester extends DefaultHandler2 { @Override public void unparsedEntityDecl(String name, String publicId, String systemId, String notation) { - if (saxLog.isDebugEnabled()) { - saxLog.debug("unparsedEntityDecl(" + name + "," + publicId + "," + systemId + "," + if (saxLog.isTraceEnabled()) { + saxLog.trace("unparsedEntityDecl(" + name + "," + publicId + "," + systemId + "," + notation + ")"); } @@ -1340,8 +1340,8 @@ public class Digester extends DefaultHandler2 { public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException { - if (saxLog.isDebugEnabled()) { - saxLog.debug( + if (saxLog.isTraceEnabled()) { + saxLog.trace( "resolveEntity('" + publicId + "', '" + systemId + "', '" + baseURI + "')"); } @@ -1354,15 +1354,15 @@ public class Digester extends DefaultHandler2 { if (entityURL == null) { if (systemId == null) { // cannot resolve - if (log.isDebugEnabled()) { - log.debug(" Cannot resolve entity: '" + publicId + "'"); + if (log.isTraceEnabled()) { + log.trace(" Cannot resolve entity: '" + publicId + "'"); } return null; } else { // try to resolve using system ID - if (log.isDebugEnabled()) { - log.debug(" Trying to resolve using system ID '" + systemId + "'"); + if (log.isTraceEnabled()) { + log.trace(" Trying to resolve using system ID '" + systemId + "'"); } entityURL = systemId; // resolve systemId against baseURI if it is not absolute @@ -1382,8 +1382,8 @@ public class Digester extends DefaultHandler2 { } // Return an input source to our alternative URL - if (log.isDebugEnabled()) { - log.debug(" Resolving to alternate DTD '" + entityURL + "'"); + if (log.isTraceEnabled()) { + log.trace(" Resolving to alternate DTD '" + entityURL + "'"); } try { @@ -1538,8 +1538,8 @@ public class Digester extends DefaultHandler2 { */ public void register(String publicId, String entityURL) { - if (log.isDebugEnabled()) { - log.debug("register('" + publicId + "', '" + entityURL + "'"); + if (log.isTraceEnabled()) { + log.trace("register('" + publicId + "', '" + entityURL + "'"); } entityValidator.put(publicId, entityURL); diff --git a/java/org/apache/tomcat/util/digester/FactoryCreateRule.java b/java/org/apache/tomcat/util/digester/FactoryCreateRule.java index a723b635db..7656f57c20 100644 --- a/java/org/apache/tomcat/util/digester/FactoryCreateRule.java +++ b/java/org/apache/tomcat/util/digester/FactoryCreateRule.java @@ -89,8 +89,8 @@ public class FactoryCreateRule extends Rule { try { Object instance = creationFactory.createObject(attributes); - if (digester.log.isDebugEnabled()) { - digester.log.debug("[FactoryCreateRule]{" + digester.match + + if (digester.log.isTraceEnabled()) { + digester.log.trace("[FactoryCreateRule]{" + digester.match + "} New " + instance.getClass().getName()); } digester.push(instance); @@ -111,8 +111,8 @@ public class FactoryCreateRule extends Rule { } else { Object instance = creationFactory.createObject(attributes); - if (digester.log.isDebugEnabled()) { - digester.log.debug("[FactoryCreateRule]{" + digester.match + + if (digester.log.isTraceEnabled()) { + digester.log.trace("[FactoryCreateRule]{" + digester.match + "} New " + instance.getClass().getName()); } digester.push(instance); @@ -144,8 +144,8 @@ public class FactoryCreateRule extends Rule { } Object top = digester.pop(); - if (digester.log.isDebugEnabled()) { - digester.log.debug("[FactoryCreateRule]{" + digester.match + + if (digester.log.isTraceEnabled()) { + digester.log.trace("[FactoryCreateRule]{" + digester.match + "} Pop " + top.getClass().getName()); } diff --git a/java/org/apache/tomcat/util/digester/ObjectCreateRule.java b/java/org/apache/tomcat/util/digester/ObjectCreateRule.java index 17331bb10e..f2d2747f7d 100644 --- a/java/org/apache/tomcat/util/digester/ObjectCreateRule.java +++ b/java/org/apache/tomcat/util/digester/ObjectCreateRule.java @@ -130,8 +130,8 @@ public class ObjectCreateRule extends Rule { public void end(String namespace, String name) throws Exception { Object top = digester.pop(); - if (digester.log.isDebugEnabled()) { - digester.log.debug("[ObjectCreateRule]{" + digester.match + + if (digester.log.isTraceEnabled()) { + digester.log.trace("[ObjectCreateRule]{" + digester.match + "} Pop " + top.getClass().getName()); } diff --git a/java/org/apache/tomcat/util/digester/SetNextRule.java b/java/org/apache/tomcat/util/digester/SetNextRule.java index 22ca0f6651..87b6ba4875 100644 --- a/java/org/apache/tomcat/util/digester/SetNextRule.java +++ b/java/org/apache/tomcat/util/digester/SetNextRule.java @@ -127,13 +127,13 @@ public class SetNextRule extends Rule { // Identify the objects to be used Object child = digester.peek(0); Object parent = digester.peek(1); - if (digester.log.isDebugEnabled()) { + if (digester.log.isTraceEnabled()) { if (parent == null) { - digester.log.debug("[SetNextRule]{" + digester.match + + digester.log.trace("[SetNextRule]{" + digester.match + "} Call [NULL PARENT]." + methodName + "(" + child + ")"); } else { - digester.log.debug("[SetNextRule]{" + digester.match + + digester.log.trace("[SetNextRule]{" + digester.match + "} Call " + parent.getClass().getName() + "." + methodName + "(" + child + ")"); } diff --git a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java index 1b8b7b1658..50f1e9c5e1 100644 --- a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java +++ b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java @@ -44,8 +44,8 @@ public class SetPropertiesRule extends Rule { // Populate the corresponding properties of the top object Object top = digester.peek(); - if (digester.log.isDebugEnabled()) { - digester.log.debug("[SetPropertiesRule]{" + digester.match + + if (digester.log.isTraceEnabled()) { + digester.log.trace("[SetPropertiesRule]{" + digester.match + "} Set " + top.getClass().getName() + " properties"); } @@ -57,8 +57,8 @@ public class SetPropertiesRule extends Rule { } String value = attributes.getValue(i); - if (digester.log.isDebugEnabled()) { - digester.log.debug("[SetPropertiesRule]{" + digester.match + + if (digester.log.isTraceEnabled()) { + digester.log.trace("[SetPropertiesRule]{" + digester.match + "} Setting property '" + name + "' to '" + value + "'"); } diff --git a/java/org/apache/tomcat/util/http/Parameters.java b/java/org/apache/tomcat/util/http/Parameters.java index 5555883614..b5deeb2bb2 100644 --- a/java/org/apache/tomcat/util/http/Parameters.java +++ b/java/org/apache/tomcat/util/http/Parameters.java @@ -107,8 +107,8 @@ public final class Parameters { charset = DEFAULT_BODY_CHARSET; } this.charset = charset; - if (log.isDebugEnabled()) { - log.debug("Set encoding to " + charset.name()); + if (log.isTraceEnabled()) { + log.trace("Set encoding to " + charset.name()); } } @@ -128,8 +128,8 @@ public final class Parameters { } this.queryStringCharset = queryStringCharset; - if (log.isDebugEnabled()) { - log.debug("Set query string encoding to " + queryStringCharset.name()); + if (log.isTraceEnabled()) { + log.trace("Set query string encoding to " + queryStringCharset.name()); } } @@ -213,8 +213,8 @@ public final class Parameters { return; } - if (log.isDebugEnabled()) { - log.debug("Decoding query " + decodedQuery + " " + queryStringCharset.name()); + if (log.isTraceEnabled()) { + log.trace("Decoding query " + decodedQuery + " " + queryStringCharset.name()); } try { @@ -275,8 +275,8 @@ public final class Parameters { private void processParameters(byte bytes[], int start, int len, Charset charset) { - if (log.isDebugEnabled()) { - log.debug(sm.getString("parameters.bytes", new String(bytes, start, len, DEFAULT_BODY_CHARSET))); + if (log.isTraceEnabled()) { + log.trace(sm.getString("parameters.bytes", new String(bytes, start, len, DEFAULT_BODY_CHARSET))); } int decodeFailCount = 0; diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java index 1c8b014739..5a961c64a1 100644 --- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java +++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java @@ -83,8 +83,8 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase { } cookieValue.toBytes(); } - if (log.isDebugEnabled()) { - log.debug("Cookies: Parsing b[]: " + cookieValue.toString()); + if (log.isTraceEnabled()) { + log.trace("Cookies: Parsing b[]: " + cookieValue.toString()); } ByteChunk bc = cookieValue.getByteChunk(); diff --git a/java/org/apache/tomcat/util/modeler/BaseModelMBean.java b/java/org/apache/tomcat/util/modeler/BaseModelMBean.java index 9c681ab5eb..02d143fa11 100644 --- a/java/org/apache/tomcat/util/modeler/BaseModelMBean.java +++ b/java/org/apache/tomcat/util/modeler/BaseModelMBean.java @@ -277,8 +277,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, "Method name is null"); } - if( log.isDebugEnabled()) { - log.debug("Invoke " + name); + if( log.isTraceEnabled()) { + log.trace("Invoke " + name); } Method method= managedBean.getInvoke(name, params, signature, this, resource); @@ -373,8 +373,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, throws AttributeNotFoundException, MBeanException, ReflectionException { - if( log.isDebugEnabled() ) { - log.debug("Setting attribute " + this + " " + attribute ); + if( log.isTraceEnabled() ) { + log.trace("Setting attribute " + this + " " + attribute ); } if( (resource instanceof DynamicMBean) && @@ -598,8 +598,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, attributeBroadcaster = new BaseNotificationBroadcaster(); } - if( log.isDebugEnabled() ) { - log.debug("addAttributeNotificationListener " + listener); + if( log.isTraceEnabled() ) { + log.trace("addAttributeNotificationListener " + listener); } BaseAttributeFilter filter = new BaseAttributeFilter(name); @@ -663,8 +663,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, { return; // This means there are no registered listeners } - if( log.isDebugEnabled() ) { - log.debug( "AttributeChangeNotification " + notification ); + if( log.isTraceEnabled() ) { + log.trace( "AttributeChangeNotification " + notification ); } attributeBroadcaster.sendNotification(notification); @@ -790,8 +790,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, throw new IllegalArgumentException("Listener is null"); } - if( log.isDebugEnabled() ) { - log.debug("addNotificationListener " + listener); + if( log.isTraceEnabled() ) { + log.trace("addNotificationListener " + listener); } if (generalBroadcaster == null) { @@ -808,8 +808,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, attributeBroadcaster = new BaseNotificationBroadcaster(); } - if( log.isDebugEnabled() ) { - log.debug("addAttributeNotificationListener " + listener); + if( log.isTraceEnabled() ) { + log.trace("addAttributeNotificationListener " + listener); } attributeBroadcaster.addNotificationListener @@ -920,8 +920,8 @@ public class BaseModelMBean implements DynamicMBean, MBeanRegistration, ObjectName name) throws Exception { - if( log.isDebugEnabled()) { - log.debug("preRegister " + resource + " " + name ); + if( log.isTraceEnabled()) { + log.trace("preRegister " + resource + " " + name ); } oname=name; if( resource instanceof MBeanRegistration ) { diff --git a/java/org/apache/tomcat/util/modeler/Registry.java b/java/org/apache/tomcat/util/modeler/Registry.java index bd473723ce..cfab3f1073 100644 --- a/java/org/apache/tomcat/util/modeler/Registry.java +++ b/java/org/apache/tomcat/util/modeler/Registry.java @@ -473,8 +473,8 @@ public class Registry implements RegistryMBean, MBeanRegistration { // Search for a descriptor in the same package if (managed == null) { // check package and parent packages - if (log.isDebugEnabled()) { - log.debug("Looking for descriptor "); + if (log.isTraceEnabled()) { + log.trace("Looking for descriptor "); } findDescriptor(beanClass, type); @@ -483,8 +483,8 @@ public class Registry implements RegistryMBean, MBeanRegistration { // Still not found - use introspection if (managed == null) { - if (log.isDebugEnabled()) { - log.debug("Introspecting "); + if (log.isTraceEnabled()) { + log.trace("Introspecting "); } // introspection @@ -599,8 +599,8 @@ public class Registry implements RegistryMBean, MBeanRegistration { * @throws Exception Error registering component */ public void registerComponent(Object bean, ObjectName oname, String type) throws Exception { - if (log.isDebugEnabled()) { - log.debug("Managed= " + oname); + if (log.isTraceEnabled()) { + log.trace("Managed= " + oname); } if (bean == null) { @@ -658,7 +658,9 @@ public class Registry implements RegistryMBean, MBeanRegistration { return; } - log.debug("Found " + dURL); + if (log.isTraceEnabled()) { + log.trace("Found " + dURL); + } searchedPaths.put(packageName, dURL); try { load("MbeansDescriptorsDigesterSource", dURL, null); diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java index 717cd606a3..07fe2c64c1 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java @@ -208,8 +208,8 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource continue; } if (!Modifier.isPublic(method.getModifiers())) { - if (log.isDebugEnabled()) { - log.debug("Not public " + method); + if (log.isTraceEnabled()) { + log.trace("Not public " + method); } continue; } @@ -221,8 +221,8 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource if (name.startsWith("get") && params.length == 0) { Class<?> ret = method.getReturnType(); if (!supportedType(ret)) { - if (log.isDebugEnabled()) { - log.debug("Unsupported type " + method); + if (log.isTraceEnabled()) { + log.trace("Unsupported type " + method); } continue; } @@ -233,8 +233,8 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource } else if (name.startsWith("is") && params.length == 0) { Class<?> ret = method.getReturnType(); if (Boolean.TYPE != ret) { - if (log.isDebugEnabled()) { - log.debug("Unsupported type " + method + " " + ret); + if (log.isTraceEnabled()) { + log.trace("Unsupported type " + method + " " + ret); } continue; } @@ -245,8 +245,8 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource } else if (name.startsWith("set") && params.length == 1) { if (!supportedType(params[0])) { - if (log.isDebugEnabled()) { - log.debug("Unsupported type " + method + " " + params[0]); + if (log.isTraceEnabled()) { + log.trace("Unsupported type " + method + " " + params[0]); } continue; } @@ -325,8 +325,8 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource ai.setSetMethod(sm.getName()); } ai.setDescription("Introspected attribute " + name); - if (log.isDebugEnabled()) { - log.debug("Introspected attribute " + name + " " + gm + " " + sm); + if (log.isTraceEnabled()) { + log.trace("Introspected attribute " + name + " " + gm + " " + sm); } if (gm == null) { ai.setReadable(false); @@ -356,8 +356,8 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource mbean.addOperation(op); } - if (log.isDebugEnabled()) { - log.debug("Setting name: " + type); + if (log.isTraceEnabled()) { + log.trace("Setting name: " + type); } mbean.setName(type); diff --git a/java/org/apache/tomcat/util/threads/LimitLatch.java b/java/org/apache/tomcat/util/threads/LimitLatch.java index c4bd3e8acc..06675dd15d 100644 --- a/java/org/apache/tomcat/util/threads/LimitLatch.java +++ b/java/org/apache/tomcat/util/threads/LimitLatch.java @@ -111,8 +111,8 @@ public class LimitLatch { * @throws InterruptedException If the current thread is interrupted */ public void countUpOrAwait() throws InterruptedException { - if (log.isDebugEnabled()) { - log.debug("Counting up["+Thread.currentThread().getName()+"] latch="+getCount()); + if (log.isTraceEnabled()) { + log.trace("Counting up["+Thread.currentThread().getName()+"] latch="+getCount()); } sync.acquireSharedInterruptibly(1); } @@ -124,8 +124,8 @@ public class LimitLatch { public long countDown() { sync.releaseShared(0); long result = getCount(); - if (log.isDebugEnabled()) { - log.debug("Counting down["+Thread.currentThread().getName()+"] latch="+result); + if (log.isTraceEnabled()) { + log.trace("Counting down["+Thread.currentThread().getName()+"] latch="+result); } return result; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org