Re: Logging all data sent to client

2007-07-25 Thread Karel V Sedlacek
Thanks Ben! Heres what I have put together, use at your own risk. any comments welcome. HttpServletResponseLoggingFilter.java public class HttpServletResponseLoggingFilter implements Filter { private Logger mLogger = Logger.getLogger(HttpServletResponseLoggingFilter.class);

Re: Logging all data sent to client

2007-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ben, I might change your LoggingHttpServletResponse slightly. I think it's more complicated than necessary. ben short wrote: LoggingHttpServletResponse.java class LoggingHttpServletResponse extends HttpServletResponseWrapper { private

Re: Logging all data sent to client

2007-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ben, ben short wrote: I ripped and altered the code of the Compression Filter servlet example from tomcat 5.5.23. One other note: since you were using a compression filter as an example, I can see why they didn't do the whole writer thing. A

Re: Logging all data sent to client

2007-07-25 Thread ben short
Hi Christopher, I ripped and altered the code of the Compression Filter servlet example from tomcat 5.5.23. There is no LoggingServletWriter, if you look in the original getWriter method the ServletOutputStream is wrapped by a PrintWriter. So your proposed change of the getWriter method to the

Re: Logging all data sent to client

2007-07-25 Thread ben short
One other note: since you were using a compression filter as an example, I can see why they didn't do the whole writer thing. A compressed stream cannot use a Writer since the output must be binary. A writer primarily handles line-ending conversion which would break any compression output

Re: Logging all data sent to client

2007-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ben, ben short wrote: I ripped and altered the code of the Compression Filter servlet example from tomcat 5.5.23. Okay. I haven't seen that example; I was just commenting on your post. There is no LoggingServletWriter, if you look in the

Logging all data sent to client

2007-07-24 Thread ben short
Hi, I using Tomcat 6.0.13 and Spring 2.0.6. I have been involved in developing a website that products pages in various formats , such as www, xml, wap and pda. We are having some issues with wap and pda, but cant ciew the html source thats being shown on the devices. We can view the html source

Re: Logging all data sent to client

2007-07-24 Thread Tim Funk
Look at the RequestDumperValve -Tim ben short wrote: Hi, I using Tomcat 6.0.13 and Spring 2.0.6. I have been involved in developing a website that products pages in various formats , such as www, xml, wap and pda. We are having some issues with wap and pda, but cant ciew the html source thats

Re: Logging all data sent to client

2007-07-24 Thread Titi Wangsa
create a httpservlet filter? On 7/24/07, ben short [EMAIL PROTECTED] wrote: Hi Tim, Thanks for that, but it only seems to log out the request/response headers. Is It possible to log everything sent to the client? Ben On 7/24/07, Tim Funk [EMAIL PROTECTED] wrote: Look at the

Re: Logging all data sent to client

2007-07-24 Thread ben short
Hi Tim, Thanks for that, but it only seems to log out the request/response headers. Is It possible to log everything sent to the client? Ben On 7/24/07, Tim Funk [EMAIL PROTECTED] wrote: Look at the RequestDumperValve -Tim ben short wrote: Hi, I using Tomcat 6.0.13 and Spring 2.0.6. I

Re: Logging all data sent to client

2007-07-24 Thread ben short
I was just looking at the compressionFilter example. Its doing along the lines of what I want todo. Thank you all. On 7/24/07, Titi Wangsa [EMAIL PROTECTED] wrote: create a httpservlet filter? On 7/24/07, ben short [EMAIL PROTECTED] wrote: Hi Tim, Thanks for that, but it only seems to log

Re: Logging all data sent to client

2007-07-24 Thread Tim Funk
Yes - but tomcat doesn't have that functionality out of the box - you'd need to write a filter which creates a HttpServletRequestWrapper which overrides getOutputStream() (or getWriter()) and then passes back a wrapped OutStream or Writer which also logs to wherever when print(int i) is

Re: Logging all data sent to client

2007-07-24 Thread ben short
Yes from the CompressionServletResponseWrapper example I can see the methods I need to override as you have pointed out. On 7/24/07, Tim Funk [EMAIL PROTECTED] wrote: Yes - but tomcat doesn't have that functionality out of the box - you'd need to write a filter which creates a

Re: Logging all data sent to client

2007-07-24 Thread Karel V Sedlacek
Ben, When you succeed at this would you pass along your code? We have issues with timeouts and it would be great to see what's being passed along to the client. Karel Cornell University Yes from the CompressionServletResponseWrapper example I can see the methods I need to override as you

Re: Logging all data sent to client

2007-07-24 Thread ben short
Yes sure. On 7/24/07, Karel V Sedlacek [EMAIL PROTECTED] wrote: Ben, When you succeed at this would you pass along your code? We have issues with timeouts and it would be great to see what's being passed along to the client. Karel Cornell University Yes from the

Re: Logging all data sent to client

2007-07-24 Thread ben short
Heres what I have put together, use at your own risk. any comments welcome. HttpServletResponseLoggingFilter.java public class HttpServletResponseLoggingFilter implements Filter { private Logger mLogger = Logger.getLogger(HttpServletResponseLoggingFilter.class); public void