DekGenius.com
[ Team LiB ] Previous Section Next Section

Recipe 4.10 Splitting Up a LogFile

Problem

Due to a large number of virtual hosts, you want to have a single logfile and split it up afterwards.

Solution

LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost
CustomLog logs/vhost_log vhost

Then, after rotating your logfile:

split-logfile < logs/vhost_log

Discussion

The LogFormat directive in this recipe creates a logfile that is similar to the common log file format but additionally contains the name of the virtual host being accessed. The split-logfile utility splits up this logfile into its constituent virtual hosts.

See Also

    [ Team LiB ] Previous Section Next Section