I use a setup like this where my logsplit.sh script writes to log files based on the %U:
<VirtualHost *:80>
ServerName myserver.com
ServerAlias *.myserver.com
VirtualDocumentRoot /home/%1/www/
LogFormat "%U %h %l %u %t \"%r\" %>s %b" common
CustomLog "|/usr/local/logsplit.sh" common
</VirtualHost>