A brief introduction to the log under Apache
Apache provides a wide range of tools for recording all aspects of run-time information. For example, a conditional log, log loop, to determine the IP address and other common problems encountered. There are also a number of third-party modules and tools used to detect the state of your Apache server and to analyze the bundle of its logs.
The default Apache log file
Apache provides a number of detection and logging tools to track the proper operation of the server. The default Apache configuration provides two log files, which are placed in the log directory under the installation directory.
Access_log this file (corresponding to the Access.log file under Windows) contains information about requests that the server has processed, such as the URL of the request, the IP address of the client, whether the request was successfully completed, and so on. Error_log this file (corresponding to the Error.log file under Windows) contains information about the error situation, as well as different large events in the server lifecycle.
Create log format LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%h %l %u %t "%r" %>s %b"
"%{Referer}i" "%{User-agent}i"" combined
Logformat instructions allow you to tell Apache which aspects of the request you want to record. And you still need additional instructions to tell Apache where to record that information, which will be covered in the next chapter. The following example shows the configuration of two of the most popular formats: the normal log format and the consolidated log format. When Apache receives a request, he will replace each domain with a% prefix with the corresponding request attribute. If you are using the normal log format, each entry in your log file will look like this: 192.168.200.4 - someuser [12/Jun/2005:08:33:34
+0500] "GET /example.png HTTP/1.0" 200 1234
if you are using the Consolidated log format, each entry in your log file will look like this: 192.168.200.4 - someuser [12/Jun/2005:08:33:34
+0500] "GET /example.png HTTP/1.0" 200 1234
http://www.example.com/index.html "Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US; rv:1.7.7)"
Although the attachment provides a detailed index of the log format, The following table describes some of the most important domains: