Error log

In this section, we are going to learn about the error log. The related directives for the error log are as follows:

  • ErrorLog
  • LogLevel

The location and the name of server log files are set by the ErrorLog directive. It is the most important log file. The Apache httpd sends the information in this and also records produced while processing. Whenever a problem occurs with the server, this will be the first place to look. It contains the details of the things that went wrong and the process of fixing it.

The error log is written into a file. On Unix systems, the errors can be sent to syslog by the server or you can pipe them to your program. The first thing in that log entry is the date and time of the message. The second entry records the severity of the error.

The LogLevel directive handles the errors sent to the error log by restricting the severity level. The third entry contains the information about the client who generated the error. That information will be the IP address. The next will be the message itself. It contains the information that the server has been configured to deny the client access. The server will then report the filesystem path of the requested document.

The various types of message can appear in the error log files. The error log file also contains the debugging output from CGI scripts. Whatever the information is written into the stderr will be directly copied to the error log.

The error log file is not customizable. The entries in the error log that deals with the requests will have corresponding entries in the access log. You should always monitor the error log for the problems during testing. On Unix systems, you can run the following command to accomplish this:

$ tail -f error_log
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset