如何使用时间戳精确到毫秒请求日志Apache 2.0中 [英] How to timestamp request logs with millisecond accuracy in Apache 2.0

查看:481
本文介绍了如何使用时间戳精确到毫秒请求日志Apache 2.0中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何配置Apache 2.0的日志格式,使其时间戳每个请求日志以毫秒(或微秒)的准确性?该文档说,戳在的strftime格式指定和strftime似乎没有不处理点儿小于秒的。

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.

推荐答案

我不认为这是可能的(而无需重写APR,ATLEAST)。 Apache使用 apr_strftime 。在Unix上,这就要求C库的strftime,但即使不填到毫秒TM结构(这并不奇怪,因为这种结构通常不支持毫秒摆在首位)。在Windows版本没有太大的不同。

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.

这篇关于如何使用时间戳精确到毫秒请求日志Apache 2.0中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆