如何格式化 Apache 记录错误的方式


How can I format the way Apache logs an error?

所以这是我得到的示例行:

[Wed Dec 03 13:18:04.922126 2014] [:error] [pid 5328:tid 812] [client 172.16.0.28:55434] <<<error/warning message>>>>, referer: http://mydomain.iosif/messages

我需要这样的东西:

[Dec 03 13:18:04] <<<error/warning message>>>>

只是为了便于调试

您可以在 VirtualHost 管道日志、ErrorLogFormat 指令中设置日志格式。或者使用 sscanf 函数解析日志