tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sumit D <>
Subject Re: Custom Valve
Date Thu, 25 Jun 2009 11:42:50 GMT
Hi Christopher*
Thank you for your response.

*By "write some data in an object" I wanted to say that, when the logs are
written, *
*then and there I would like to have the same information encapsulated in an
because we need to send it to our framework.

Another option would be analyzing
the logs and extracting the info. But I thought it might be a bit easier to
get it in
some object.

I will either modify the AccessValveLog class or just extend it to meet our

by the way, I could not find META-INF/context.xml. I create from scratch ?

Also, if I put the <Valve className="my.Valve">...........code in the
server.xml of Tomcat, would'nt it work just like AccessLogValve ??

Thanks once again,

On Wed, Jun 24, 2009 at 11:39 PM, Christopher Schultz <> wrote:

> Hash: SHA1
> Sumit,
> On 6/24/2009 10:48 AM, Sumit D wrote:
> > Hello All!I am trying to edit the AccessLogValve and then would
> > rename it to some other Valve. Presently, the AccessLogValve writes
> > logs, but I would like to write the same data in an object as well.
> > Any pointers on how can I achieve this ?? I might be able to add some
> > code where it writes to logs, so that it will also write to some
> > object.
> What do you mean when you say "write some data in an object"?
> > But then I have no idea how to Deploy this custom valve.
> Deploying the valve is easy:
> 1. Compile it to .class file(s)
> 2. JAR your .class files into a .jar file
> 3. Put your .jar file into $CATALINA_HOME/lib
> 4. Add a <Valve className="my.Valve"> element to your <Context>
>   element in META-INF/context.xml in your webapp
> > Also, Valve Component specifies that the log "pattern" supports many
> > things like %h, %l, etc but so far, i could not find how can I
> > include all those(pattern codes) in the log file.
> You'll just have to read the code. Start with the "createLogElements"
> method and read everything it calls. It's pretty straightforward.
> - -chris
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla -
> a7gAn0gSUe1mAmtVQmM5N8JNzaovpUny
> =68qu
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message