Pivotal Knowledge Base


Logging user defined cookies with Apache 2.0 and the usertrack module (2008211)

Logging user defined cookies with Apache 2.0 and the usertrack module (2008211)


This article provides information about using the usertrack module to log user defined cookies in Apache HTTP Server 2.0 and vFabric Enterprise Ready Server 4.0.


The CustomLog directive along with the usertrack module can be used to track user defined cookies. The usertrack module can be enabled by adding this line to your httpsd.conf file:

LoadModule usertrack_module       "/usr/local/ERS/4.0.3/apache2.2/modules/standard/mod_usertrack.so"

This directive is best added to httpsd.conf near the block of LoadModule directives at the beginning of the file.

This is an example configuration that makes use of a cookie (named mycookie) that you want to track in your logs:

CookieName mycookie
CookieTracking On
CustomLog logs/cookie.log "%{Cookie}n ""%r"" %t"

Note: mycookie is only an example of a valid cookie name. Valid cookie names depend on your application and configuration, but one must be provided.

The logfile cookie.log shows the use of the cookie mycookie by user requests. Previous versions of Apache httpd provided the CookieLog directive to define where cookies were logged. This directive is now deprecated in favor of the CustomLog directive used in conjunction with the usertrack module. 

Additional Information

For more information about using mod_usertrack, see http://httpd.apache.org/docs/2.0/mod/mod_usertrack.html.
©VMware 2013


Powered by Zendesk