Normal 0 0 2 false false en-US JA x-none MicrosoftInternetExplorer4
Apache , Tomcat Log Settings
I. Apache log overview
Apache contains two types of logs: error log, access log.
Error log: Storage of diagnostic information and processing of errors in the request, often containing the details of the error and how to troubleshoot, server startup or running problems, you should first view this log.
Access log: Logs all requests processed by the server. ii. The method of the Apache log content recording
Official description Reference for the log: http://httpd.apache.org/docs/2.2/ja/logs.html 1. access log ① use combined to get more detailed logs
Configuration:
Edit httpd.conf File
Customlog
Customlog Logs/access_log combined
The format is not lost, and additional information is available (Referer and user-agent).
Adaptation situation:
Server exceptions caused by a particular request can be helpful. ② custom Log format
Configuration:
Detailed content: http://httpd.apache.org/docs/2.2/ja/mod/mod_log_config.html
Adaptation situation:
Server exceptions caused by a particular request can be helpful. ③ use mod_security to record POST-delivered data
Configuration:
Http://www.modsecurity.org/documentation/index.html
Adaptation situation:
Enhance the security of Apache. ④ multiple file access log
Configuration:
Logformat "%h%l%u%t/"%r/"%>s%b" common
Customlog Logs/access_log Common
Customlog Logs/referer_log "%{referer}i->%u"
Customlog Logs/agent_log "%{user-agent}i"
Adaptation situation:
Logs different log information to different files, easy to find their own interest in the log. ⑤ Condition Log
Configuration:
# don't record requests from machines
Setenvif remote_addr "127/.0/.0/.1" DontLog
# Requests for robots.txt files are not logged
Setenvif Request_uri "^/robots/.txt$" DontLog
# Record Other requests
Customlog Logs/access_log Common Env=!dontlog
Adaptation situation:
Get the log content that interests you. ⑥ other log files
Configuration:
module |
directive |
effect |
adaptation |
Mod_logio |
Logformat strong> |
Record actual bytes received and sent |