Apache 2 has rotatelogs, which seems to do what is says, which is, allow me to define a location and a pipe for a virtual host, and have, in this case, the error_log rotated by size, or by time.
I am on OS X, and logrotate is not available, looks like syslog is used, but Apache is not logging to syslog in this case, nor do I believe that would be what I want to do. If I have syslog take over, it will rotate, zip, email, and much more, but I then have to hup Apache, I believe that is a little brute force.
I am only working on error_log today, and would like a log file that is 200K in size, then rotated. rotatelogs takes 1M as a value, can I use something like .2M?
Another reason I believe syslog would not work, is that I would then have to define a line in the syslog config settings every time I add a new virtual host.
With Apache's rotatelogs, there are two issues:
1) Logs have root owner, is there any way to define what the owner is, or any of the permissions for that matter?
2) There are hundreds of virtual hosts, I want to keep 10 logs or so, and then delete the rest. Is this usually solved with unix find and gzip and rm, etc.?
Summary: I have /path/www/lastname.firstname/logs/ where lastname.firstname will be hundreds of directories. error_log needs to go to the logs directory for that lastname.firstname. I am looking for how to make sure these log files do not get too large and out of control. I actually want them very small, so users can quickly download them and see errors while they are developing. Users will not be given shell access, so they cannot use something like tail -f on the logs.