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?