Web Hosting Talk







View Full Version : Error Logs


bert
05-19-2001, 09:56 AM
Does anyone know if apache creates an error log for each site? and if it does, where can I find it?

Thanks!

jtan15
05-19-2001, 11:54 AM
By default, Apache will create one large error log for each web site. You can usually find it in the apache_root/logs/error_log file. But you can specify in your httpd.conf file to give each vhost (web site) a unique error log file.

In the vhost for the site, insert this line:

ErrorLog /location/to/error_log

Once you reboot Apache, that customer's error files will no longer go in the master error_log file, but instead in their own log file.

Hope this helps! :)

bert
05-19-2001, 12:13 PM
I knew about the error_log file, I just wanted to have an error_log file that would only log the errors for a particular site.

I didn't know that the ErrorLog directive in httpd.conf would do that.

Thanks a lot Vincent! :)

jtan15
05-19-2001, 12:17 PM
No problem. You can also use a similar technique with "CustomLog" to get an access_log for each user. :)

bert
05-19-2001, 12:19 PM
I might need that too!

Now that your here, is there a way to "tune up" the error logs?

This is a request that I received from a customer earlier today:

I was wondering if it would be at all possible to turn up the level of error messages i get in the error log for my site. I've got scripts dying but no information is left in the error log save for the warnings i output myself.

Can this be done?

jtan15
05-19-2001, 07:15 PM
Yes, there is a way. In your httpd.conf file, look for the directive:

LogLevel

It is probably set to "warn". These are the options you can set after it:

LogLevel debug info notice warn error crit alert emerg

It sounds like you will want the "debug", "warn", and "error" turned on. If that doesn't do the trick, try using some of the other levels.

bert
05-19-2001, 07:34 PM
I tried with:

LogLevel debug warn error

and apache would not restart. Do I have to put each one on a separate line like this:

LogLevel debug
LogLevel warn
LogLevel error

I am doing something wrong? What is the correct syntax?

jtan15
05-19-2001, 10:36 PM
Sorry, my mistake. You can actually only have one level of warning. Taken from the apache.org web site:

emerg
Emergencies - system is unusable.
"Child cannot open lock file. Exiting"
alert
Action must be taken immediately.
"getpwuid: couldn't determine user name from uid"
crit
Critical Conditions.
"socket: Failed to get a socket, exiting child"
error
Error conditions.
"Premature end of script headers"
warn
Warning conditions.
"child process 1234 did not exit, sending another SIGHUP"
notice
Normal but significant condition.
"httpd: caught SIGBUS, attempting to dump core in ..."
info
Informational.
"Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers)..."
debug
Debug-level messages
"Opening config file ..."

So you might want to try:

LogLevel error

bert
05-19-2001, 10:50 PM
Thanks again Vincent. :)

I guess I could have looked that up myself :(