Apache CustomLog to log full URL

I'd like to add a CustomLog directive to my apache configuration to log the full URL requested (or at least the host portion of the URL). I have several domains being handled by the same instance of apache, and would like to be able to distinguish the domains in the logs (as now all I see is "GET /"). I see in the documentation on LogFormat it lists %U to print the path portion of the URL, but I'm looking for the host.


Keep reading the LogFormat documentation and you'll find:

%...{Foobar}i:  The contents of Foobar: header line(s) in the request
                sent to the server.

Which means you could include in your configuration:

%{Host}i

The %v and %V directives may also get you what you want.

%v will always be the value of ServerName (the "canonical name" of your virtual host). %V may be the value of ServerName, or it may be the value of the HTTP Host header, depending on whether or not you have UseCanonicalName enabled in your configuration (and whether or not the client supplied a Host header).


LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i%U%q" combined

%{Host}i%U%qgives full url.


'%v' is the ServerName might be what you want?