Either use the requestdumper valve provided by tomcat (to dump headers
and form submission)
Either create a ServletFilter that will decorate the HttpServletRequest
and the HttpServletResponse and forward those decorated object to the
followup of processing chain
(http://java.sun.com/products/servlet/Filters.html).
In the decoration put code to output somewhere the result as it's
writent to the response outputstream by servlet.

Keith Hawkridge a écrit :
> Hi, is it possible to give me an answer for both?
>
> keith
>
> -----Original Message-----
> From: Christopher Schultz [mailto:[EMAIL PROTECTED]
> Sent: 18 December 2006 14:35
> To: Tomcat Users List
> Subject: Re: logging the all the request/response http messages for my
> application
>
> Keith,
>
> Keith Hawkridge wrote:
> > Hi, I have an application setup via a context and I want to view all
> the
> > http request/response messages that deals with this context.
>
> > Is there any easy way to set this up with tomcats logging?
>
> Do you want to log all of the HTTP headers and parameters, or do you
> want to log all of the content, too?
>
> Logging the headers and parameters is pretty easy (including the headers
> being returned in the response). The most obvious way is to write a
> filter that just dumps that information wherever you want it. Some of
> Tomcat's valves may help (such as the RequestDumperValve -
> http://tomcat.apache.org/tomcat-5.0-doc/catalina/docs/api/org/apache/cat
> alina/valves/RequestDumperValve.html).
>
> If you want to log all of the content, then your job becomes more
> difficult, because the content of a request cannot be read twice. In
> order to capture and log the content, your filter will have to wrap the
> request and response in specialized objects that will serve that content
> out of buffers held for the purposes of allowing that data to be read
> multiple times. If you don't do this, some of your code may stop
> working.
>
> Good luck,
> -chris
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to