This is an automated email from the ASF dual-hosted git repository.
markt 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 0b680f0231 Review logging trace level: msg + exception
0b680f0231 is described below
commit 0b680f0231aa2f1f9b70f76d910371b8a9fce1a4
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Aug 20 16:23:18 2025 +0100
Review logging trace level: msg + exception
---
java/org/apache/catalina/servlets/CGIServlet.java | 4 +++-
java/org/apache/catalina/tribes/Channel.java | 13 +++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/java/org/apache/catalina/servlets/CGIServlet.java
b/java/org/apache/catalina/servlets/CGIServlet.java
index 6940e2598e..4283c2cacd 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -425,7 +425,9 @@ public final class CGIServlet extends HttpServlet {
}
}
} catch (IllegalStateException ise) {
- log.trace("Request Parameters: [Invalid]", ise);
+ if (log.isTraceEnabled()) {
+ log.trace("Request Parameters: [Invalid]", ise);
+ }
}
log.trace("Protocol: [" + req.getProtocol() + "]");
log.trace("Remote Address: [" + req.getRemoteAddr() + "]");
diff --git a/java/org/apache/catalina/tribes/Channel.java
b/java/org/apache/catalina/tribes/Channel.java
index 988b2015f8..809b4adfdb 100644
--- a/java/org/apache/catalina/tribes/Channel.java
+++ b/java/org/apache/catalina/tribes/Channel.java
@@ -279,8 +279,8 @@ public interface Channel {
void start(int svc) throws ChannelException;
/**
- * Shuts down the channel. This can be called multiple times for
individual services to shut down.
- * The svc parameter can be the logical or value of any constants
+ * Shuts down the channel. This can be called multiple times for
individual services to shut down. The svc parameter
+ * can be the logical or value of any constants
*
* @param svc one of:
* <ul>
@@ -480,8 +480,7 @@ public interface Channel {
case "synchronized_ack", "sync" -> SEND_OPTIONS_SYNCHRONIZED_ACK;
case "udp" -> SEND_OPTIONS_UDP;
case "use_ack" -> SEND_OPTIONS_USE_ACK;
- default ->
- throw new IllegalArgumentException(String.format("[%s] is
not a valid option", opt));
+ default -> throw new IllegalArgumentException(String.format("[%s]
is not a valid option", opt));
};
}
@@ -499,8 +498,10 @@ public interface Channel {
return Integer.parseInt(input);
} catch (NumberFormatException nfe) {
final Log log = LogFactory.getLog(Channel.class);
- log.trace(String.format("Failed to parse [%s] as integer,
channelSendOptions possibly set by name(s)",
- input), nfe);
+ if (log.isTraceEnabled()) {
+ log.trace(String.format("Failed to parse [%s] as integer,
channelSendOptions possibly set by name(s)",
+ input), nfe);
+ }
}
String[] options = input.split("\\s*,\\s*");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]