The AccessLogValve configuration in Confluence 10 and beyond contains the wrong time unit designation

XMLWordPrintable

    • 2
    • Severity 3 - Minor
    • 18

      Issue Summary

      The AccessLogValve configuration in Confluence 10 and beyond contains the wrong time unit designation.

      server.xml
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                                 directory="logs"
                                 maxDays="30"
                                 pattern="%t %{X-AUSERNAME}o %I %h %r %s %Dms %b %{Referer}i %{User-Agent}i"
                                 prefix="conf_access_log"
                                 requestAttributesEnabled="true"
                                 rotatable="true"
                                 suffix=".log"
                          />
      

      Tomcat 9 uses milliseconds for the %D parameter, whereas Tomcat 10 writes %D values in microseconds, but the designation set is still 'ms', misleading administrators on request processing time by a factor of 1000.

       

      Steps to Reproduce

      1. Install Confluence 10.x (Tomcat 10)
      2. Curl the /status endpoint and/or look at the times in the access logs. They appear to be milliseconds (due to the 'ms' unit string) but in fact are microseconds (so should be 'μs' or even 'us')

      Expected Results

      [05/Aug/2026:15:55:16 +1000] - http-nio-8090-exec-6 0:0:0:0:0:0:0:1 GET /status HTTP/1.1 200 9050μs 19 - curl/8.7.1
      

      Actual Results

      The time appears to be in milliseconds, but it is not. In Tomcat 9, this would look like 9.050 seconds (9050ms) but because it is 9050μs (microseconds), it's 0.00905 seconds.

      [05/Aug/2026:15:55:16 +1000] - http-nio-8090-exec-6 0:0:0:0:0:0:0:1 GET /status HTTP/1.1 200 9050ms 19 - curl/8.7.1
      

      Workaround

      1. Modify the AccessLogValve entry in server.xml and change the %D parameter to %{ms}T which will start recording in milliseconds. For example:
        pattern="%t %{X-AUSERNAME}o %I %h %r %s %{ms}Tms %b %{Referer}i %{User-Agent}i" 
        
      1. Restart Confluence for the new setting to take effect.

              Assignee:
              Niraj Bhawnani
              Reporter:
              Malcolm Ninnes
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: