Sunday, September 11, 2011

Print incoming and outgoing cookie through Apache Access log

Sometimes its really very useful to print the incoming and outgoing cookie (or any other http header) from Apache Server to debug Http Session or Loan Balancer related issues.

We can modify the LogFormat in httpd.conf file to print our custom logging. Following format will print incoming and outgoing cookies.

"%h %l %u %t %T \"%r\" %>s %b\n\t\t\t\
   Cookie %{Cookie}i\n\t\t\t\
   Set-Cookie %{Set-Cookie}o"

1 comment: