I would like a solution to my problem where i have 100s of domains on an apache server. I don't want a separate log file for each domain i want them to share a log file. This is easy enough if i don't need to rotate them. For instance i can use
CustomLog "/var/log/apache2/access_log" "%h %v %l %u %t \"%r\" %>s %b" ErrorLog "/var/log/apache2/error_log"
This works fine but i used this and noticed that my log file is 6GB. So i want the log files to be rotated with the apache program rotatelogs. So I tried to add some rotation on one of my virtual hosts.
CustomLog '|/usr/sbin/rotatelogs "/var/log/apache2/access_log" 604800 0' "%h %v %l %u %t \"%r\" %>s %b"
The problem was that it added some numbers after the access_log so the other domains didn't write to the same file as the rotated one. Is there some way of having all the domains write to the same file and have the file rotated? if i put the log rotate in to all the virtual hosts will it use the same file or will each domain overwrite the file? What should i do with the 6GB access_log?