Overview of Logging Information

Apache Error Log

The apache error log records information about any warnings or errors the server encounters. When debugging an application or troubleshooting web-related issues, this information is invaluable. By default, the location of the Apache error log is defined in /etc/httpd/conf/httpd.conf:

  • ErrorLog logs/error_log

The full path to the Apache error log, by default, is /etc/httpd/conf/logs/error_log.

Using the tail command, error messages can be viewed as they are recorded by Apache. This is tremendously useful as it allows a user to refresh a web page and see specifically which errors are generated.

  • tail -fn0 /path/to/logfile

By default, tail will print the last 10 lines of a file, but using the flags fn0 allows the user to see realtime information. The f flag represents the follow operation. This command tells tail to display appended data as the file grows. The n flag displays the last N lines, while 0 represents line 0 in the log file. With these three flags, line 0, or the first line in the log, is always displayed even as more data is written to the file, providing a user with a real-time view of messages written to the log.

Note to customers with Linux Builder or Linux Builder+ accounts:

Access to the general log and error log of each site is available. To test, use FTP to log into the server and browse to the 'logs' directory. If the log files are visible, the tail command can be used after establishing an SSH connection to the server. If a '550 directory listing denied' error appears within the FTP client, please contact technical support to have access granted to the directory.

Mail Log

Another tremendously useful log file is the mail log. Within this file is all information pertaining to all mail transactions handled by the mail program on the server. By default, the log is located at /var/log/maillog.

Specifically, this log contains information such as date and time, message ID, delivery status, error codes, and DNS information about sender/recipient hosts. The following line is an entry in the log of a message sent successfully:

Nov 21 18:44:24 ServerName postfix/smtp[13544]: 2A7A110299: to=, relay=gmail-smtp-in.l.google.com[74.125.93.27]:25, delay=0.46, delays=0.01/0.01/0.06/0.38, dsn=2.0.0, status=sent (250 2.0.0 OK 1290383914 u7si9738878qco.191)

The mail log provides valuable information when attempting to troubleshoot mail delays, missing email, mail sent from a web form, or even issues with a local mail client such as Outlook.