Cookie information in log file

Sebastian Geib sebastian.geib at td-solutions.org
Thu Jun 19 12:05:50 MSD 2008


Hi everyone,

Hopefully someone here can help me with an issue I am currently facing 
regarding logging in nginx.

We have a customer who uses Google Urchin, the commercial version of 
Google analytics. This tracker needs the cookie information in the last 
field of any given line in the log file. Apparently Apache is able to 
put that information in there from what the Google Urchin help pages 
say: 
https://secure.urchin.com/helpwiki/en/UTM_Quick-Install_%28Apache%29?highlight=%28utm%29

At the moment I am using the following log format for our nginx servers:
   log_format main
     '$remote_addr - $remote_user [$time_local] '
     '"$request" $status $body_bytes_sent '
     '"$http_referer" "$http_user_agent" '
     '"$http_x_forwarded_for"';

In the wiki on codemongers I couldn't find something regarding this 
cookie information and also Google wasn't very helpful.

Is there something like $http_cookie which I could simply append to my 
current log format that would bring the same functionality as the log 
format Google describes for Apache?

Thank you in advance for any hints.

Sebastian





More information about the nginx mailing list