Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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