Custom Apache log Formats

Log Files. ….. he he …. i hate em…

Apache Servers can be customized to create log file to record hits of user activity on a certain website. These logs are automatically configured by default. The Default log format called as "Extended Log Format" provides you exhaustive information about User's IP , browser agent, file requested, server responmse HTTP Referral,  etc.

but the default log format is not usually compete. in the sense, the default log format wont help me to identify a user session. ( because default session tracking uses ip/user agent config. if i am browsing from my company the entire company has the same external ip and almost the same browser agent. so i cant be uniquely identified ). SO in order to provide a stong Session Tracking machanism . We will need to use a modified log format which can also track cookies. This is called the combined cookie format.

About Cookies.

There are two kinds of cookies. First party cookies and Third party cookies.

Cookies which are set and retrieved  by the same we-server are called first party cookies. If  a cookies is set bey a third party website, then it is called TPC. normally Third party cookies have a high rejection rate. So its always advised to use a first party cookie.

Apache Server can be configured to set persistent First party Cookies.

Default Log Format

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" extended

Now Lets examine the Combined cookie log format

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined-cookie

So once these cookies are configured to log.

We can configure a new session tracking mechanism (Admin Console, select Web Analysis > Options > Session Tracking > add\edit a Session Tracking definition .) in webtrends to process the persistent cookie set by our apache server.

Now you can unleash the power of web log analytics. Most Reports in webtrends can be enabled with this configuration change.

2 Responses to “Custom Apache log Formats”

  1. DEEPU Says:

    sorry da. onnume pirila. [:P]


  2. Krishna Shasankar Says:

    it happens…


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>