vlogger
virtual web logfile rotater/parser


vlogger is a little piece of code i wrote to handle dealing with large amounts
of virtualhost logs. its bad news to let apache deal with these itself (ask anyone who
runs a large webfarm about the interesting things apache does when it has 500 open logfiles)
so vlogger was born. it takes piped output from apache, splits off
the first field, and writes the logs to logfiles in subdirectories. it uses a file handle
cache so it can't run out of file descriptors. it will also start a new logfile every night
at midnight, and maintain a symlink to the most recent file. for security, it can drop privileges
and do a chroot to the logs directory.

it's very similar (and intended as a replacement for) cronolog or httplog,
except for the fact that you don't need to run 1000 of them.

you need to add a "%v" as the first part of your logformat, like this:

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

then call it from a customlog like this:

CustomLog "| /usr/local/sbin/vlogger -s access.log -u www-logs -g www-logs /var/log/apache" combined

this will write all your logfiles in subdirectories under /var/log/apache,
named "mmddyyyy-access.log" with a symlink named "access.log".

or, you can use it with an errorlog (as of v0.2):

ErrorLog "| /usr/local/sbin/vlogger -e -s error.log -u www-logs -g www-logs /var/log/apache"

this writes a single log named "mmddyyyy-error.log" with a symlink named "error.log".

new in vlogger is the option to track usage statistics to a database (sum total of file sizes for bandwidth stats).
see the included perldoc for info on setting this up.

get vlogger: vlogger-1.3.tar.gz

send feedback if you are using vlogger in production, i'd like to hear about it!