xampp Apache 設定 access.log
設定access.log以天數分割檔案,如: access-2020-10-29.log
1. 開啟httpd.conf
2. 找到access.log配置項目
3. 將設定改成
4. CustomLog "|bin/rotatelogs.exe -l E:/logs/access/access-%Y-%m-%d.log 86400" common
設定access.log的format
參考配置項目:
http://httpd.apache.org/docs/current/mod/mod_log_config.html
https://httpd.apache.org/docs/2.4/logs.html
log format標準
Common Log Format
"%h %l %u %t \"%r\" %>s %b"
Combined Log Format
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
elf (Extended Log File Format)
rotatelogs .exe
apache log能做到這些是是因為使用了rotatelogs .exe。
rotatelogs 是日誌切割工具。
文件: https://httpd.apache.org/docs/2.4/programs/rotatelogs.html
留言
張貼留言