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

markt-asf 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 056e2bd4ce Simplify - based on PR #1002 by Fabian Hahn
056e2bd4ce is described below

commit 056e2bd4cef6a0bf20696a72f6d8686189b77e96
Author: Mark Thomas <[email protected]>
AuthorDate: Sat May 2 15:36:38 2026 +0100

    Simplify - based on PR #1002 by Fabian Hahn
---
 .../apache/catalina/valves/AbstractAccessLogValve.java  | 17 +++--------------
 webapps/docs/config/valve.xml                           |  2 +-
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java 
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 44a70d180a..360c1ebbd9 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1624,17 +1624,6 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
             this.style = style;
         }
 
-        /**
-         * Creates a new ElapsedTimeElement that will log the time in the 
specified style.
-         *
-         * @param micros <code>true</code>, write time in microseconds - %D
-         * @param millis <code>true</code>, write time in milliseconds, if 
both arguments are <code>false</code>, write
-         *                   time in seconds - %T
-         */
-        public ElapsedTimeElement(boolean micros, boolean millis) {
-            this(micros ? Style.MICROSECONDS : millis ? Style.MILLISECONDS : 
Style.SECONDS);
-        }
-
         @Override
         public void addElement(CharArrayWriter buf, Request request, Response 
response, long time) {
             style.append(buf, time);
@@ -2194,7 +2183,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
                 } else if ("fracsec".equals(name)) {
                     return new 
ElapsedTimeElement(ElapsedTimeElement.Style.SECONDS_FRACTIONAL);
                 } else {
-                    return new ElapsedTimeElement(false, false);
+                    return new 
ElapsedTimeElement(ElapsedTimeElement.Style.SECONDS);
                 }
             default:
                 return new StringElement("???");
@@ -2219,7 +2208,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
             case 'B':
                 return new ByteSentElement(false);
             case 'D':
-                return new ElapsedTimeElement(true, false);
+                return new 
ElapsedTimeElement(ElapsedTimeElement.Style.MICROSECONDS);
             case 'F':
                 return new FirstByteTimeElement();
             case 'h':
@@ -2243,7 +2232,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
             case 't':
                 return new DateAndTimeElement();
             case 'T':
-                return new ElapsedTimeElement(false, false);
+                return new 
ElapsedTimeElement(ElapsedTimeElement.Style.SECONDS);
             case 'u':
                 return new UserElement();
             case 'U':
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index ec00e39570..fb19da1ce8 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -287,7 +287,7 @@
     <li><b><code>%A</code></b> - Local IP address</li>
     <li><b><code>%b</code></b> - Bytes sent, excluding HTTP headers, or '-' if 
zero</li>
     <li><b><code>%B</code></b> - Bytes sent, excluding HTTP headers</li>
-    <li><b><code>%D</code></b> - Time taken to process the request in 
microseconds</li>
+    <li><b><code>%D</code></b> - Time taken to process the request, in 
microseconds</li>
     <li><b><code>%F</code></b> - Time taken to commit the response, in 
milliseconds</li>
     <li><b><code>%h</code></b> - Remote host name (or IP address if
         <code>enableLookups</code> for the connector is false)</li>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to