I have a webserver set up with Apache that responds to several  Aliases - basically it is some type of a parking page for unused domains. I wanted to capture which URL the user actually entered in my logfiles.

It took me a while to figure it out, but I did end up setting up a custom logfile format that does the trick:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{HOST}i\"" complete_log
CustomLog /var/log/apache/your.domain.com/complete.log complete_log

Basically this creates a standard combined log, with the actual request hostname appended at the end:

127.0.0.1 - - [16/Dec/2004:19:49:40 +0100] "GET /favicon.ico HTTP/1.1" 404 287 "-" "Mozilla/5.0 (X11; U; Linux i686; chrome://navigator/locale/navigator.properties; rv:1.7.5) Gecko/20041107 Firefox/1.0" "your.domainalias.com"