On 12/09/2025 13:00, Poojashree Prakash wrote:
+1
Java9 and above supports precision logging - timestamp - Current time in
microseconds in java - Stack Overflow
<https://stackoverflow.com/questions/1712205/current-time-in-microseconds-in-java>
Also considering - Apache Tomcat® - Which Version Do I Want?
<https://tomcat.apache.org/whichversion.html>
tomcat11 Supports java 17 and above
tomcat10 Support java 11 and above
tomcat9 Supports java 8 and above
So, does Tomcat provide any way to log access timestamps with microsecond
precision?
If not, is there an upcoming plan to enable true microsecond precision in
timestamps for Tomcat logs?
I stand corrected.
There are no currently plans for microsecond precision in timestamps for
either logs or the access log.
There are a number of things any implementation would need to take
account of:
- Tomcat 9 has a minimum Java version of 8 so Instant might not be
available for log messages. It is likely some form of JreCompat based
solution would be required for Tomcat 9
- Converting the timestamps to strings would need some thought. The
timestamp to String conversions in Tomcat are heavily optimised for
performance. Work would be required to determine if that were still
necessary and, if it were, to develop appropriate solutions
- The access log valve implementations would need to be converted to use
Instant. A bigger issue is the API uses milliseconds. The API and
configuration would need to be updated in a backwards compatible way
for this to be available on anything earlier than Tomcat 12.
All of which begs the question. Why? What is it that you are trying to
do that you can't do with the current millisecond logs and microseconds
for request processing time?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org