I've got Apache 2.2 running on Debian 7 (on a VPS), with virtual hosts defined for several different websites.
I've set up individual error and access logs for each vhost, but I've not found a way to rotate/archive the logs to my liking.
Of course the default Apache logs on Debian are rotated by logrotate, but I don't find this particularly satisfactory for various reasons - primarily because I want archived logs to be named by date, and because configuring it separately for each vhost seems cumbersome. I'm also unsure about deleting old logs automatically; I might want to do this manually only after downlading them from the server.
My ideal solution would do the following every month (or maybe week) :
- Append the date to the filename, or move the file to a date-named subfolder.
- Gzip the archived files.
I also need this to be easy to set up for multiple vhosts.
Ideally, it should not involve restarting apache (though a graceful restart is not the end of the world).
What is the best way to set this up? I'm sure it's been done before...