tags:

views:

1218

answers:

2

How do I configure Apache 2.0's log format so that it timestamps each request log with millisecond (or microsecond) accuracy? The docs say that timestamps are specified in strftime format and strftime doesn't seem to handle anyting smaller than seconds.

+1  A: 

I don't think it's possible (without rewriting APR, atleast). Apache uses apr_strftime. On Unix, this calls the C library's strftime, but doesn't even fill milliseconds into struct tm (not surprisingly, because this structure doesn't usually support milliseconds in the first place). The Windows versions isn't much different.

Martin v. Löwis
That's what I suspected, thanks for the details.
Ben Williams
%D The time taken to serve the request, in microseconds.
HardQuestions
+1  A: 

use %D option for microsecond accuracy

Kerem Can Karakaş
That measures the time taken to process each request, and not the timestamp for each request.
Seun Osewa