logging cookies

I am using WS 7.0 on a Solaris 10 Sparc server. I am trying to use a custom log format and record cookies.

I have entered "%Req->headers.cookie.name%" in the format area for the access log file but in the log files show a "-" (dash) in where I am expecting cookie information.

Has anyone had this trouble? Anyone know how to fix this?

Larry

[365 byte] By [sgtrocka] at [2007-11-27 10:17:10]
# 1

Chris has a nice example of cookie logging in his blog:

http://blogs.sun.com/elving/entry/user_tracking_cookie

The gist of it is to log the $cookie{'NAME'} variable rather than trying to pull it from the pblock.

A sample access log format line from that blog entry is:

"%Req->reqpb.clf-request%" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length% "$cookie{'VISITID'}"

This would log the cookie called VISITID to the access log if present.

JoeMcCabea at 2007-7-28 15:49:58 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

This worked for me. Thank you for the pointer.

A funny thing I found. The first line of the access code defines the format. But the first line does not match the actual format of the access log.

sgtrocka at 2007-7-28 15:49:58 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

You would get into this kind of scenario if you try to the change the log format of the existing access log file via GUI/CLI. It is always recommended to specify a new access log file if you want to change the log format.

If you use the Administration GUI and try to change the format of the existing file, you would be seeing a javascript warning message.

amit-suna at 2007-7-28 15:49:58 > top of Java-index,Web & Directory Servers,Web Servers...