View headers of HTML requests to apache
You can create a custom LogFormat containing headers:
%{Foobar}i : The contents of Foobar: header line(s) in the request sent to the server. Changes made by other modules (e.g. mod_headers) affect this. If you're interested in what the request header was prior to when most modules would have modified it, use mod_setenvif to copy the header into an internal environment variable and log that value with the %{VARNAME}e described above.
Then reuse this LogFormat on your AccessLog directive
LogFormat "%v %h %l %u %t \"%r\" %>s %b %{MySpecialHeader}i " my_special_format
CustomLog logs/access_log_with_details my_special_format
Or even in one line only:
CustomLog logs/access_log_with_details "%v %h %l %u %t \"%r\" %>s %b %{MySpecialHeader}i"
UPDATE:
A note about the SetEnvIf:
This part is made to store the value of the Header on the start of any internal rewrite, and then then, instead of using the %{FOO}i
syntax to extract the header at the end of the process you would use the %{MyEnvVar}e
to log the value backuped at the beginning, this is the syntax to log an environment variable.
So ending with something like that:
SetEnvIf MySpecialHeader "(.*)" BACKUPHEADER=$1
(... stuff and things ...)
CustomLog logs/access_log_with_details "init: %{BACKUPHEADER}e final: %{MySpecialHeader}i "