This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new f2d843ef8a Review logging trace level: msg + exception
f2d843ef8a is described below

commit f2d843ef8aceaf9ca4eab9a61659e6a4bf27c240
Author: Mark Thomas <ma...@apache.org>
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 6703b8f583..76bcd1b89e 100644
--- a/java/org/apache/catalina/servlets/CGIServlet.java
+++ b/java/org/apache/catalina/servlets/CGIServlet.java
@@ -431,7 +431,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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to