This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new db6afcd8ff Differentiate trace and debug log levels
db6afcd8ff is described below
commit db6afcd8ff831066495f65db53af84375de675a1
Author: remm <[email protected]>
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 | 36 ++++-----
.../org/apache/tomcat/util/LocalStrings.properties | 2 +
.../util/descriptor/web/LocalStrings.properties | 1 +
.../tomcat/util/descriptor/web/WebRuleSet.java | 43 +++++-----
.../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 +-
18 files changed, 170 insertions(+), 170 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 e819bd207c..af2df111ec 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -57,8 +57,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, StringBuilder actualMethod) {
- if (log.isDebugEnabled()) {
- log.debug("IntrospectionUtils: setProperty(" +
+ if (log.isTraceEnabled()) {
+ log.trace("IntrospectionUtils: setProperty(" +
o.getClass() + " " + name + "=" + value + ")");
}
@@ -132,7 +132,7 @@ public final class IntrospectionUtils {
params[0] = InetAddress.getByName(value);
} catch (UnknownHostException exc) {
if (log.isDebugEnabled()) {
- log.debug("IntrospectionUtils: Unable to
resolve host name:" + value);
+
log.debug(sm.getString("introspectionUtils.hostResolutionFail", value));
}
ok = false;
}
@@ -141,8 +141,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());
}
}
@@ -362,8 +362,8 @@ public final class IntrospectionUtils {
if (newval.equals(value)) {
return value;
}
- if (log.isDebugEnabled()) {
- log.debug("IntrospectionUtils.replaceProperties iter on: " +
newval);
+ if (log.isTraceEnabled()) {
+ log.trace("IntrospectionUtils.replaceProperties iter on: " +
newval);
}
return replaceProperties(newval, staticProp, dynamicProp, classLoader,
iterationCount+1);
}
@@ -452,8 +452,8 @@ public final class IntrospectionUtils {
if (target == null || methodN == null || param1 == null) {
throw new
IllegalArgumentException(sm.getString("introspectionUtils.nullParameter"));
}
- if (log.isDebugEnabled()) {
- log.debug("IntrospectionUtils: callMethod1 " +
+ if (log.isTraceEnabled()) {
+ log.trace("IntrospectionUtils: callMethod1 " +
target.getClass().getName() + " " +
param1.getClass().getName() + " " + typeParam1);
}
@@ -466,8 +466,7 @@ public final class IntrospectionUtils {
}
Method m = findMethod(target.getClass(), methodN, params);
if (m == null) {
- throw new NoSuchMethodException(target.getClass().getName() + " "
- + methodN);
+ throw new
NoSuchMethodException(sm.getString("introspectionUtils.noMethod", methodN,
target, target.getClass()));
}
try {
return m.invoke(target, new Object[] { param1 });
@@ -483,16 +482,14 @@ public final class IntrospectionUtils {
m = findMethod(target.getClass(), methodN, typeParams);
if (m == null) {
if (log.isDebugEnabled()) {
- log.debug("IntrospectionUtils: Can't find method " + methodN +
- " in " + target + " CLASS " + target.getClass());
+ log.debug(sm.getString("introspectionUtils.noMethod", methodN,
target, target.getClass()));
}
return null;
}
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++) {
@@ -502,7 +499,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) {
@@ -533,15 +530,14 @@ public final class IntrospectionUtils {
result = InetAddress.getByName(object);
} catch (UnknownHostException exc) {
if (log.isDebugEnabled()) {
- log.debug("IntrospectionUtils: Unable to resolve host
name:" +
- object);
+
log.debug(sm.getString("introspectionUtils.hostResolutionFail", object));
}
}
// 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/LocalStrings.properties
b/java/org/apache/tomcat/util/LocalStrings.properties
index fd149493ea..3daefd93b0 100644
--- a/java/org/apache/tomcat/util/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/LocalStrings.properties
@@ -31,5 +31,7 @@ diagnostics.vmInfoThreadMxBean=ThreadMXBean capabilities
introspectionUtils.conversionError=Error converting [{0}] to type [{1}]
introspectionUtils.getPropertyError=Error getting property [{0}] on class [{1}]
+introspectionUtils.hostResolutionFail=Cannot resolve host name [{0}]
+introspectionUtils.noMethod=Cannot find method [{0}] in object [{1}] of class
[{2}]
introspectionUtils.nullParameter=Method name, parameter and object target
arguments must not be null
introspectionUtils.setPropertyError=Error setting property [{0}] to [{1}] on
class [{2}]
diff --git a/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
b/java/org/apache/tomcat/util/descriptor/web/LocalStrings.properties
index 55e40e0c12..f9f3b0366f 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 69360d320a..7fa4327082 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java
@@ -801,9 +801,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)");
}
StringBuilder code = digester.getGeneratedCode();
@@ -832,8 +832,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)");
}
@@ -862,8 +862,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)");
}
@@ -904,14 +904,13 @@ final class SetPublicIdRule extends Rule {
try {
m = top.getClass().getMethod(method, paramClasses);
} catch (NoSuchMethodException e) {
- digester.getLogger().error("Can't find method " + method + " in "
- + top + " CLASS " + top.getClass());
+ digester.getLogger().error(sm.getString("webRuleSet.noMethod",
method, top, top.getClass()));
return;
}
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] + ")");
}
@@ -943,8 +942,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());
}
StringBuilder code = digester.getGeneratedCode();
@@ -959,8 +958,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());
}
StringBuilder code = digester.getGeneratedCode();
@@ -1141,8 +1140,8 @@ final class IgnoreAnnotationsRule extends Rule {
} else {
value = null;
}
- if (digester.getLogger().isDebugEnabled()) {
- digester.getLogger().debug
+ if (digester.getLogger().isTraceEnabled()) {
+ digester.getLogger().trace
(webXml.getClass().getName() + ".setMetadataComplete( " +
webXml.isMetadataComplete() + ")");
}
@@ -1175,8 +1174,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() + ")");
}
@@ -1257,8 +1256,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()");
}
@@ -1498,8 +1497,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)");
}
StringBuilder code = digester.getGeneratedCode();
diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java
b/java/org/apache/tomcat/util/digester/CallMethodRule.java
index 3eae7a53db..b3fd085ba7 100644
--- a/java/org/apache/tomcat/util/digester/CallMethodRule.java
+++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java
@@ -348,7 +348,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 ");
@@ -373,7 +373,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 aaa2c60fba..ba532b5a9f 100644
--- a/java/org/apache/tomcat/util/digester/Digester.java
+++ b/java/org/apache/tomcat/util/digester/Digester.java
@@ -906,8 +906,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);
@@ -923,11 +923,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()");
}
}
@@ -970,14 +970,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
@@ -998,7 +998,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) {
@@ -1011,7 +1011,7 @@ public class Digester extends DefaultHandler2 {
}
} else {
if (debug) {
- log.debug(sm.getString("digester.noRulesFound", match));
+ log.trace(sm.getString("digester.noRulesFound", match));
}
if (rulesValidation) {
log.warn(sm.getString("digester.noRulesFound", match));
@@ -1028,7 +1028,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) {
@@ -1062,8 +1062,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
@@ -1096,8 +1096,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
@@ -1116,8 +1116,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
@@ -1144,8 +1144,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;
@@ -1163,8 +1163,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
@@ -1180,8 +1180,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) {
@@ -1220,10 +1220,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
@@ -1248,7 +1248,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
@@ -1259,7 +1259,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) {
@@ -1272,7 +1272,7 @@ public class Digester extends DefaultHandler2 {
}
} else {
if (debug) {
- log.debug(sm.getString("digester.noRulesFound", match));
+ log.trace(sm.getString("digester.noRulesFound", match));
}
}
@@ -1290,8 +1290,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
@@ -1318,8 +1318,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 + ")");
}
}
@@ -1336,8 +1336,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 + ")");
}
@@ -1369,8 +1369,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 + "')");
}
@@ -1383,15 +1383,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
@@ -1411,8 +1411,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 {
@@ -1564,8 +1564,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 a1ee8aac9e..7fdff66531 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 9332dc9a8a..748da616b9 100644
--- a/java/org/apache/tomcat/util/digester/ObjectCreateRule.java
+++ b/java/org/apache/tomcat/util/digester/ObjectCreateRule.java
@@ -144,8 +144,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 b7f973d4ea..5ed5867fb4 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 64a7ff282a..5c2c6e6d68 100644
--- a/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
+++ b/java/org/apache/tomcat/util/digester/SetPropertiesRule.java
@@ -65,8 +65,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");
}
@@ -83,8 +83,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 16995ccd55..d179e9977f 100644
--- a/java/org/apache/tomcat/util/http/Parameters.java
+++ b/java/org/apache/tomcat/util/http/Parameters.java
@@ -75,8 +75,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());
}
}
@@ -86,8 +86,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());
}
}
@@ -153,8 +153,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 {
@@ -203,8 +203,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 pos = start;
diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
index cfcb4308e1..79780358c2 100644
--- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
@@ -86,8 +86,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 174c443772..30760700d5 100644
--- a/java/org/apache/tomcat/util/modeler/BaseModelMBean.java
+++ b/java/org/apache/tomcat/util/modeler/BaseModelMBean.java
@@ -279,8 +279,8 @@ public class BaseModelMBean implements DynamicMBean,
MBeanRegistration,
sm.getString("baseModelMBean.nullMethodName"));
}
- if( log.isDebugEnabled()) {
- log.debug("Invoke " + name);
+ if( log.isTraceEnabled()) {
+ log.trace("Invoke " + name);
}
Method method= managedBean.getInvoke(name, params, signature, this,
resource);
@@ -374,8 +374,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) &&
@@ -599,8 +599,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);
@@ -664,8 +664,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);
@@ -791,8 +791,8 @@ public class BaseModelMBean implements DynamicMBean,
MBeanRegistration,
throw new
IllegalArgumentException(sm.getString("baseModelMBean.nullListener"));
}
- if( log.isDebugEnabled() ) {
- log.debug("addNotificationListener " + listener);
+ if( log.isTraceEnabled() ) {
+ log.trace("addNotificationListener " + listener);
}
if (generalBroadcaster == null) {
@@ -809,8 +809,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
@@ -921,8 +921,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 eaa9961a26..e5034453d7 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -477,8 +477,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);
@@ -487,8 +487,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
@@ -603,8 +603,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) {
@@ -662,7 +662,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: [email protected]
For additional commands, e-mail: [email protected]