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 asCustomLog “/private/var/log/apache2/access_log” commonThe access log file contains Requester IP, time of the 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 the Apache server. The default file is configured in httpd.conf asErrorLog “/private/var/log/apache2/error_log”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.