cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <>
Subject RE: [PATCH]: Re: Logging all requests
Date Wed, 14 Apr 2004 17:49:04 GMT

I have a couple of uses for this, but I'll need to modify it slightly. I
actually need access before and after the request.  Before the request I
need to do audit logging and capture the start time.  After the request I
want to update our JMX statistics.  Currently I have to do all this with a
servlet filter, but I would prefer to do this with a Cocoon component.

My proposals:
1. Change the name from RequestLogger to RequestMonitor (or something else)
as it is not necessarily a Logger and doesn't extend one.
2. Provide two methods; 
	void monitorRequestStart(Environment env)
	void monitorRequestEnd(Environment env)
3. Change the code in to call both methods.

Note that these methods return void instead of boolean, as could
care less what happened inside these calls.  Also, the calls should be
wrapped in try/catch blocks that log and ignore any errors in these methods
since, again, doesn't care.

I'll be happy to provide a patch to do all this.


-----Original Message-----
From: Surjan Singh [] 
Sent: Wednesday, April 07, 2004 9:53 AM
Subject: [PATCH]: Re: Logging all requests

> Hello,
> I'd like to log all Requests so that we can record them for analysis.
> So, far the only way I think I can do this is to modify the method
> process(..) in org.apache.cocoon. In this method, I thought I could use
> a logging component (which has yet to be created) from the component
> manager and (if it exists) to invoke a log method on it.
> What do you think? Is this the right way to go about this?
> Surj

Hello again,

Ok, I've created a patch that will do the above. Patch is attached. I 
think you'll need to do a patch -P1 from with the coocon-2.1 cvs dir.

To use the new component, add a line similar to the following in your 

    <component class="<your-package>.RequestLoggerImpl" 
logger="requestlogger" role="org.apache.cocoon.RequestLogger"/>

Also, there are comments in the RequestLogger interface that explain how 
to use it (a bit).

Let me know what you think.


View raw message