问题
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:
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.
回答2:
use %D option for microsecond accuracy
来源:https://stackoverflow.com/questions/335433/how-to-timestamp-request-logs-with-millisecond-accuracy-in-apache-2-0