Apache splitting logs

apache-2.2logging

I've a log of a busy website that grows very fast. I'd like to know if there's a way to "split" the log file every day without using external tools.

EDIT: My Fault, I'm on a Windows server 2003, Apache Version 2.0.64.

Best Answer

Apache httpd is capable of writing error and access log files through a pipe to another process, rather than directly to a file. This capability dramatically increases the flexibility of logging, without adding code to the main server. In order to write logs to a pipe, simply replace the filename with the pipe character "|", followed by the name of the executable which should accept log entries on its standard input.

You can use this technique to pipe the logs to a script which then splits the logs in any way you like. This is often used to split by virtual host.

Related Topic