You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Eliot Sykes <in...@juxti.com> on 2002/04/19 15:58:38 UTC

best place for code for logging of request attributes from client?

Hi all,
For every request made to the Turbine servlet, I'd like to log request
attributes such as IP, sessionid, and user agent data to a database.

I plan on using log4j's JDBCAppender.  What I'm stuck on is how to
organise where the code goes for this logging.  I was hoping someone
would be able to help me who might have encountered a similar situation.

I'm worried that I'm barking up the completely wrong tree, but I've been
reading the Turbine docs and i think I should create a class that
implements the RunDataService interface for handling this logging. This
class should then be given a line in TR.props like the existing Run Data
Services, e.g. something like:

services.RunDataService.default.run.data
	=org.apache.turbine.services.rundata.DefaultTurbineRunData

I'm under the impression that some method from classes like the
DefaultTurbineRunData class above are called once per request.  My class
would then execute the code for logging request data for every request
if it was implemented as suggested.

Like I said I'm concerned I've got this completely wrong, so I'd really
appreciate if someone could give me a little direction on this matter.
Is this a way of implementing the logging I want? Regardless of if it is
or isn't a way, is there a generally accepted way for implementing per
request logging that I've missed?  If so could someone please give me
some pointers on where to start to look to find out about it? Thanks in
advance,

Eliot

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>