Web Hosting Talk







View Full Version : error logs for vhosts


Jake29
04-16-2002, 09:04 AM
Does anyone know how to set up unique error logs for each name based virtual host under apache? Is it possible to do this without opening a new file per vhost in apache.conf?

Jake

Shyne
04-16-2002, 06:13 PM
Edit the httpd.conf file, or httpd.include in Plesk. Add the following lines between the <VirtualHpst></VirtualHost> tags.

TransferLog /path/to/where/the/log/will/saved
ErrorLog /path/to/where/the/log/will/saved

smash
04-18-2002, 12:24 AM
Be aware that if you have more than 200 virtual hosts you will run into troubles. Apache will keep every of these files open and when there is too many it causes troubles..

MotleyFool
04-18-2002, 03:32 AM
Jake,

I may be mistaken, but is it not possible to run a cron job that would periodically parse the errorlog file and split them into vhost-error.log files?

Cheers
Balaji

smash
04-18-2002, 03:40 AM
You're right. It is not possible to include the "server name" as an element of the errorlog entry, thus making it impossible to parse the error log like you can parse an access log..

For this reason we only provide access logs to customers. Never had any complaint about it.

Jake29
04-18-2002, 08:00 AM
Thanks everybody!

So i guess I am now wondering aloud how Cpanel/WHM does it. They offer a custom error page for each vhost. Can any of you Cpanel hosting providers take a look at apache.conf (or any included files) and tell us whether apache keeps an error log open for each vhost? Do any Cpanel developers want to spill the beans? It would be greatly appreciated, if it doesn't reveal any closely guarded trade secrets.

Jake

Starhost
04-18-2002, 02:34 PM
Originally posted by smash
You're right. It is not possible to include the "server name" as an element of the errorlog entry, thus making it impossible to parse the error log like you can parse an access log..

For this reason we only provide access logs to customers. Never had any complaint about it.

Can you give an example on how to do this? I can't figger out how to do it. :(