View Full Version : Log Files

WestHost - MCox
07-23-2008, 04:37 PM
Hello all,

Here is some information on where to find log files for some common applications, as well as how to enable logging for some applications.

Here they are in no particular order:

Logging is enabled by default.
Log files are found in /var/log/httpd/

Logging can be enabled by changing the LogLevel setting in /etc/mail/sendmail.cf from 0 to 9 (the number can be set higher, but 9 is for standard logging).
Log files are found in /var/log/maillog

Logging can be enabled by un-commenting the following lines in /etc/ftpaccess:

#log commands real
#log transfers anonymous,real inbound,outbound

#virtual logfile /ftp/sites/ftp.alphacorporation.com.log
The path shown in the line above can be changed to log to wherever you would like. I would suggest changing it to /var/log/ftplog. So, the line, after removing the comment, would look like this:

virtual logfile /var/log/ftplog

Logging can be enabled by editing your /etc/.qpopper-options. In that file, un-comment this line:

#set statistics=true
And change this line:

set log-facility=local7

set log-facility=local0
Log files can be found at /var/log/messages

Logging can be enabled by editing /etc/php.ini. In that file change the log_errors setting from "Off" to "On".
Log files will be found in the location specified by the error_log setting in /etc/php.ini. As such, I would suggest changing the default line for that setting from:

;error_log = filename

error_log = /var/log/phplog
Please note the need to un-comment that line. Also, Apache will need to be restarted for the changes to php.ini to be recognized. You can restart Apache via SSH by entering the 'apachectl restart' command, or you can restart it from your Site Manager using the "Restart Account" option.

Error logging is enabled by default.
The error log can be found at /var/lib/mysql/yourdomain.com.err

Query logging can be enabled by editing the /etc/my.cnf file. Under the [mysqld] line, insert this:

log = /var/log/mysqllog
This will set the log to go to /var/log/mysqllog
MySQL will need to be restarted for the log to be enabled after editing the file. You can restart it by using the '/etc/rc.d/init.d/mysqld restart' command via SSH, or you can restart it from your Site Manager using the "Restart Account" option.

Editing these files is beyond the scope of what technical support will do for you. So, this information is for those who are comfortable with editing their own configuration files. Also, I would strongly suggest not leaving logging enabled for longer than is needed for troubleshooting. Leaving logs enabled that aren't enabled by default can cause the log file to grow to proportions such that all of your disk space if used up by the log file, which can cause other problems for you.

Each application uses their own formats for logging. For information on how to read the log files, I suggest checking out the online documentation for each application individually.

If you would like to see information on logs for any application that is offered by WestHost that I have neglected to mention here, please post a request for it and I'll be happy to add it.

10-12-2008, 04:49 PM
After hours of running round in circles trying to figure how I destroyed my blog's admin interface, the info on turning on php error logging solved it for me. Within 5 minutes it pointed me to an unwanted space at the end of a file. It really was that simple.

I should have looked here hours ago before I began tearing out my hair!

Thanks a million Mark