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:Which means you could include in your configuration:
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 ofServerName
, or it may be the value of the HTTPHost
header, depending on whether or not you haveUseCanonicalName
enabled in your configuration (and whether or not the client supplied aHost
header).%{Host}i%U%q
gives full url.'%v' is the ServerName might be what you want?
Add
%v
to your log format.Something like this: