2017-05-29 90 views
0

這是我的錯誤日誌格式:Apache的錯誤日誌格式

ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \"%{Referer}i\" \"%{User-Agent}i\"" 

有時我:

(70007)The timeout specified has expired: [client *(client IP)*:57108] AH01075: Error dispatching request to : (polling) 

但是,沒有腳本名/ HTTP請求/文件名=沒用。

我只是想在錯誤(或查詢,如果存在)的{%script_name%},例如與最大excution超時我沒有任何請求/文件名。

是否有可能無法訪問日誌

我有PHP-fpm的7.1 + 2.4的Apache(無MOD PHP)

回答

0

我還沒有找到針對該請求字符串的任何簡單ErrorLogFormat令牌。相反,我使用mod_rewrite來設置一個可以在ErrorLogFormat中使用的變量。

我使用這些設置:

RewriteEngine on 
RewriteRule .* - [E=REQ:%{THE_REQUEST}] 
ErrorLogFormat "[%{cu}t] [%a] \\n% \ Server:\ %V\\n% \ Request:\ %{REQ}e\\n% \ %M\\n% \ Referrer:\ %{Referer}i\\n% \ UserAgent:\ %{User-Agent}i\\n"