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

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

commit 2af4fc803af20a7cb08424e441c8d8a7164c49a4
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 afb2c2ad63..c7333c2aeb 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1578,17 +1578,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);
@@ -2134,7 +2123,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
                         case "us" -> new 
ElapsedTimeElement(ElapsedTimeElement.Style.MICROSECONDS);
                         case "ms" -> new 
ElapsedTimeElement(ElapsedTimeElement.Style.MILLISECONDS);
                         case "fracsec" -> new 
ElapsedTimeElement(ElapsedTimeElement.Style.SECONDS_FRACTIONAL);
-                        case null, default -> new ElapsedTimeElement(false, 
false);
+                        case null, default -> new 
ElapsedTimeElement(ElapsedTimeElement.Style.SECONDS);
                     };
             default -> new StringElement("???");
         };
@@ -2153,7 +2142,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
             case 'A' -> new LocalAddrElement(ipv6Canonical);
             case 'b' -> new ByteSentElement(true);
             case 'B' -> new ByteSentElement(false);
-            case 'D' -> new ElapsedTimeElement(true, false);
+            case 'D' -> new 
ElapsedTimeElement(ElapsedTimeElement.Style.MICROSECONDS);
             case 'F' -> new FirstByteTimeElement();
             case 'h' -> new HostElement();
             case 'H' -> new ProtocolElement();
@@ -2165,7 +2154,7 @@ public abstract class AbstractAccessLogValve extends 
ValveBase implements Access
             case 's' -> new HttpStatusCodeElement();
             case 'S' -> new SessionIdElement();
             case 't' -> new DateAndTimeElement();
-            case 'T' -> new ElapsedTimeElement(false, false);
+            case 'T' -> new 
ElapsedTimeElement(ElapsedTimeElement.Style.SECONDS);
             case 'u' -> new UserElement();
             case 'U' -> new RequestURIElement();
             case 'v' -> new LocalServerNameElement();
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 4b422eadda..b66e660830 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