So, I've been using cronolog for years with this directive:
<VirtualHost *:80>
SetEnv origin SND
ServerName sandman.net
CustomLog "|/usr/bin/cronolog [..]/logs/SND/log_%Y-%m.txt" combined
</VirtualHost>
Problem is that with a lot of virtual hosts, I suddenly reach my maximum of open file descriptors when apache is spawning cronolog.
With some googling (and searching here) I've found no solution for this, so is there none? As you can see, I set an ENV variable in Apache to "SND" for that vhost, what I would LIKE to do is something like this:
CustomLog "|/usr/bin/cronolog [..]/logs/${origin}/log_%Y-%m.txt" combined
<VirtualHost *:80>
SetEnv origin SND
ServerName sandman.net
</VirtualHost>
Which, theoretically, would spawn just one cronolog process that writes to the correct vhost log file.
But it seems that the pipe commend isn't parsed for Apache variables in any stage of the process, which means that the only solution that I can see is that I add ${origin} to the LogFormat and then write my own log rotate script that will parse out (and ignore) the vhost variable and then write the rest of the log line to the appropriate file. But will this be less overhead?
Any other suggestions?