[Zope] Tracking Users in Zope

Chris McDonough chrism@zope.com
Mon, 22 Jul 2002 12:56:34 -0400


> Chris McDonough wrote:
> > You could use an External Method as an Access Rule which writes
the
> > session id, URL, and time of each page request out to a logfile.
>
> Can you explain what you mean by "use an External Method as an
Access Rule"?

You can take a peek at
http://saints.homeunix.com:8081/ZopeBook/ZopeServices.stx under
"Access Rule Services" to understand a bit more about access rules.
(In case you're wondering, this is the "development" version of the
Zope Book on my home machine and it may not be up all the time).

Create an external method like so:

def accessrule(self, container, request, logfile='/some/file/name'):
    log = open(logfile, 'a')
    session = self.session_data_manager.getSessionData()
    session_id = session.getId()
    ... find out everything else you need to write out to the log
    here using the request and whatnot, then write to the logfile...
    log.write([whatever you want to write to the logfile])
    log.close()


... then set it as an access rule in the folder where you want to
track user behavior ... then write a script to analyze the logfiles
it produces.

>
> Regarding the analysis of resulting data I would leverage existing
> analysis tools. If you make the External method write the log data
in
> 'combined Apache http log format' you will be able to use wusage
(it's
> shareware) which does what you want.

Really?  It analyzes traffic patterns with session ids in them?  I
didn't think the combined format had a "slot" for session ids.  I
think it definitely needs to be custom.

>
> Is there a free http log analysis tool which can do user behaviour
tracking?

There may be something along with mod_usertrack in Apache, I'm not
sure.

- C