In last article, we saw how to install Apache on Mac OS X, today we will learn some basic things about apache logs in Mac OS X.
By default apache logs are present in
/private/var/log/apache2/ directory and you can access it with root user. There are two types of log files configured in apache configuration file (httpd.conf) which are;
- Access Log – This file contains all the requests made to the apache server. Its configured in httpd.conf as
CustomLog “/private/var/log/apache2/access_log” common
The access log file contains Requester IP, time of request, HTTP method (GET, POST etc.), the resource requested, HTTP response code and the size of the response. If you are having your own virtual host, then its always better to configure its access logs file.
- Error Log – This file contains the error logs for any request made to apache server. The default file is configured in httpd.conf as
This file entry contains requester IP, type of error, error information and the resource which is causing the error.
There is no application in Mac OS X for better viewing of apache logs but if you are on Windows, you can try Apache Log Viewer.