Splitlog

This little program is used on our webservers to divide the Apache logfiles amongst our clients. Because of the way we configured Apache (with mod_vhost_alias), logs of many different virtual domains are written to a single file by the webserver.
Since we wanted our customers to be able to analyze their own logfiles, splitlog was developed. Now, instead of writing to a file, Apache writes its logs to a pipe, with this program on the other side.
To accomplish this, we simply put the following line in the apache configuration file:
  Customlog |/usr/local/bin/splitlog vcombined
Splitlog reads from the pipe line by line, decides which domain, and writes the line to the logfile in that virtual domain's directory.