tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: Access-log ordering
Date Fri, 19 Apr 2013 18:18:09 GMT
On 18.04.2013 23:58, Christopher Schultz wrote:

Mark is of course right. Adding some info here concerning your log format:

> We are using the following format string:
> "%a %t &quot;%r&quot; %s %D"

> The value of "%t" is the interesting one, of course, but it's
> resolution is only in seconds, and we are seeing an access log file
> like this:
> [18/Apr/2013:16:19:08 -0400] "POST /request/B HTTP/1.1" 200 108
> [18/Apr/2013:16:19:08 -0400] "POST /request/A HTTP/1.1" 200 263

In TC 7 you can log start time and end time and also milliseconds:

%{begin}t %{begin:msec_frac}t %{end}t %{end:msec_frac}t

or (maybe a bit slower but formatted more nicely)

%{begin:dd/MMM/yyyy:HH:mm:ss.SSS Z}t %{end:dd/MMM/yyyy:HH:mm:ss.SSS Z}t

The %{begin:msec}t and %{end:msec}t can also be useful. They are
milliseconds since the epoch, so not nicely readable for humans, but
nice for doing calculations.

AFAIR times are consistent if you use multiple formatting tokens, to te
time for begin and end is only taken once and then the various formats
use those two time values consistently.

The "end:" prefix is the default, so it can be ommitted.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message