apache如果格式化错误日志的所记录的时间

apache的错误日志中所记录的时间很别扭,请问如何格式化呢?

[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test

调整为

[2000/10/11 14:32:52] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test
阅读 3.5k
1 个回答

更改httpd.conf中配置 LogFormat "%{%Y/%M/%d}t"%r\" %>s %b" common
具体可参考mod_log_config和strftime的man page。

其中时间格式可以使用strftime的时间格式。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题