找到: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
再后面加上图片文件的类型
SetEnvIf Request_URI \.gif$ gif-p_w_picpath
SetEnvIf Request_URI \.GIF$ gif-p_w_picpath
SetEnvIf Request_URI \.jpg$ gif-p_w_picpath
SetEnvIf Request_URI \.JPG$ gif-p_w_picpath
SetEnvIf Request_URI \.png$ gif-p_w_picpath
SetEnvIf Request_URI \.js$ gif-p_w_picpath
SetEnvIf Request_URI \.bmp$ gif-p_w_picpath
SetEnvIf Request_URI \.css$ gif-p_w_picpath
SetEnvIf Request_URI \.mid$ gif-p_w_picpath
SetEnvIf Request_URI \.swf$ gif-p_w_picpath
SetEnvIf Request_URI \.mmf$ gif-p_w_picpath
SetEnvIf Request_URI \.wma$ gif-p_w_picpath
SetEnvIf Request_URI \.midi$ gif-p_w_picpath
记日志时
CustomLog /usr/local/apache/logs/access.log combined env=!gif-p_w_picpath
转载于:https://blog.51cto.com/more3/1681949