简体   繁体   中英

How to timestamp request logs with millisecond accuracy in Apache 2.0

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.

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.

使用%D选项获得微秒精度

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM