We're running Apache 2.2.9 (Win32) with a few virtual hosts configured on the one server. Each has it's own ErrorLog and CustomLog settings which are in the format of "logs/[domain name]-error.log" and "logs/[domain name]-access.log". Unfortunately these are now creating quite large files.
On IIS you can specify the log schedule, which can put them in a daily format of "yymmdd.log". Is there something similar I can do here?
It doesn't have to be daily either, weekly or monthly will do. I'd just like to break them up so that we can keep X amount instead of everything it's ever logged. A quick Google seems to bring up lots of Linux orientated answers involving log splitters, scripts and cron jobs which isn't too helpful for a Windows installation.
Thanks to radius, I tweaked my httpd-vhosts.conf to use Apache's built in rotatelogs command, in the following format:
ErrorLog "|bin/rotatelogs logs/[domain name]-error.%Y-%m-%d-%H_%M_%S.log 5M"
CustomLog "|bin/rotatelogs logs/[domain name]-access.%Y-%m-%d-%H_%M_%S.log 5M" common
They'll create a new log file when the current one reaches 5MB. I know that's not daily as asked for, but that keeps them at a manageable size which will do. I did try the rotate after so many seconds but it didn't seem to be putting the time stamp in the file name correctly (specifically hours, minutes and seconds).