Adding cookie information to apache log files

The typical apache combined log format configuration is :

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

But by appending a simple element, %{Cookie}i, one can record cookie information into the logfile:

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

${Cookie}i will insert the contents of the HTTP Cookie request header as received by apache.

Notice that I renamed the logformat from combined to combined-cookie.
You have to then update any sections in the apache config that use the combined reference to use combined-cookie. Alternatively, you could just edit the combined log format in place to not have to update the rest of the config file.