Sun Java System Web Server 6.1 SP11 Administrator's Guide

Easy Cookie Logging

The Sun Java System Web Server has an easy way to log a specific cookie using the flexlog facility. Add Req->headers.cookie.cookie_name to the Init fn=flex-init line in the magnus.conf file. This logs the value of the cookie variable cookie_name if the cookie variable is present in the request header, and logs - if it is not present.


Example 10–1 To log all cookies

Init fn=flex-init format.access="%Ses->client.ip% - %Req->vars.auth-user% 
[%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% 
%Req->srvhdrs.content-length% %Req->headers.cookie.jsessionid%""


Note –

All cookie names and header names must be in lowercase.