I have a server that runs a bunch of VirtualHosts for each of our client sites (~ 30 sites). I've got the VHosts configured so that each site has its own log, which is stored in <public>/../log/access.log, and similarly for an error log.

I would like to create a server-wide log of some basic information from every request - specifically time, status code, and virtual host. Preferably, I would like to store this information in one file, rather than parsing each of the separate access logs.

Is there a way to tell Apache to follow one CustomLog in addition to all the ones in the actual VHost files?


You can pipe the logs from CustomLog. You can then use tee, for instance, to send them to different destinations (possibly processing them beforehand). There's an example at fnal.gov:

ErrorLog  "|/usr/bin/tee -a /var/log/www/error.log  | /usr/bin/logger -thttpd -plocal6.err"
CustomLog "|/usr/bin/tee -a /var/log/www/access.log | /usr/bin/logger -thttpd -plocal6.notice" extended_ncsa

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.