How to timestamp request logs with millisecond accuracy in Apache 2.0

北城余情 提交于 2019-12-23 12:27:21

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!