我修改了配置rsyslogd
禁用RSYSLOG_TraditionalFileFormat
。
但仍然是apache日志/var/log/apache/error.log
仅显示第二精度。
还有什么需要配置的吗?
At http://httpd.apache.org/docs/current/mod/mod_log_config.html http://httpd.apache.org/docs/current/mod/mod_log_config.html您会看到不同的时间格式,包括毫秒
只需更改自
%t
to
%{%d/%b/%Y:%T}t-%{msec_frac}t for miliseconds
or
%{%d/%b/%Y:%T}t-%{usec_frac}t for microsecs
例子:
2013年3月16日:22:44:34-634
2013 年 3 月 16 日:22:44:34-634200
文档阿帕奇
%t 收到请求的时间,格式为 [18/Sep/2011:19:18:28 -0400]。最后一个数字表示与 GMT 的时区偏移
%{format}t 时间,采用 format 给出的形式,应采用扩展的 strftime(3) 格式(可能是本地化的)。如果格式以 begin:(默认)开头,则时间是在请求处理开始时所用的时间。如果以 end 开头:这是写入日志条目的时间,接近请求处理的结束。除了 strftime(3) 支持的格式之外,还支持以下格式标记:
sec 自纪元以来的秒数
msec 自纪元以来的毫秒数
usec 自纪元以来的微秒数
msec_frac 毫秒分数
usec_frac 微秒分数
这些标记不能相互组合,也不能在同一格式字符串中进行 strftime(3) 格式化。您可以改用多个 %{format}t 标记。
strftime(3) 格式化
http://man7.org/linux/man-pages/man3/strftime.3.html http://man7.org/linux/man-pages/man3/strftime.3.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)