tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: logging input and output HTTP message payload
Date Wed, 17 Jun 2015 18:32:38 GMT
Just to make sure..

Milinda Perera wrote:
> Hi all,
> 
> Thanks for suggestions,
> 
> Actually I want to log all HTTP / HTTPS requests from client applications
> to my Tomcat server and the Response sent back to the client. And logging
> requests and payloads are not target specific application running in the
> Tomcal server, which means all the request to the Tomcat server and all the
> responses from the Tomcat server
> 
> My requirement cannot be fulfilled with external tools like wireshark
> because:
>       1. unable to log HTTPS requests and responses
>       2. And I need to get logged requests and responses in server side log
> files without external tools.

Are you aware of the volume of data that this could be ? and about the performance impact

? and about the complexity of doing this in any way that would be useful ?

HTTP requests tend to be small  : a request line like "GET /mylogo.jpg HTTP/1.1", and a 
few text headers). But the response to that request may be very large (a 120 KB jpeg 
file).  Multiply by the number of requests for your homepage etc. (and never mind if you 
are returning large PDF documents sometimes...)

And then, to log this jpeg logo file in any useful manner, you would have to
a) analyse the response, to see what is sent back
b) encode this in some way, to write it usefully to your logfile (you do not want binary 
data there, I presume)

These are probably some of the reasons why the standard logging methods don't do that.

> 
> by changing  *org.apache.coyote.level=FINE *in log properties logs HTTP
> requests to the server, but does not log response.
> 
> Highly appreciate if you guys can share your thoughts to achieve this.
> 

Ask the NSA for some tips ?

> Thanks,
> Milinda
> 
> 
> 
> On Wed, Jun 17, 2015 at 5:56 PM, André Warnier <aw@ice-sa.com> wrote:
> 
>> Frederik Nosi wrote:
>>
>>> It helps only with HTTP though, no HTTPS or at least not easily.
>>>
>>> While we are at this, are you trying to debug a SOAP / REST connection
>>> from your application running on Tomcat to another server or a connection
>>> coming from outside to your Tomcat?
>>>
>>>
>>> On 06/17/2015 11:16 AM, Mark Thomas wrote:
>>>
>>>> On 17/06/2015 10:10, Milinda Perera wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I need to log HTTP payload content for debugging purposes.
>>>>>
>>>> Use Wireshark. That has the added benefit of not having any unwanted
>>>> side-effects on your application.
>>>>
>>>> Mark
>>>>
>>>>
>> If this is for one debugging session, you could also simply use an add-on
>> to a browser (such as Fiddler2 for IE), and record the full exchanges there.
>> It has the advantage that you see the complete traffic in both directions
>> (headers and content), and that you can easily switch between different
>> presentations of the data, and save it to file if you need to.  And
>> depending on what you are looking for, it may be a lot easier to handle
>> than Wireshark.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message