[Zope-dev] support for low level HTTP Response logging?

Clemens Robbenhaar robbenhaar@espresto.com
Tue, 25 Feb 2003 12:17:39 +0100


Hi Romain,

 > Yo,
 > 
 > searching the zope site and googling yielded too many data and no info, 
 > so I might as well ask it here.
 > 
 > We are very interested in finding out the exact HTTP Responses that the 
 > zope server pushes towards the client.
 > 
 > So is there a low level hook for logging the http responses ?
 > We want the exact response, complete with all header info etc.

 There is no  explicit hook, but you might add Your logging code in 
Zope/lib/python/ZPublicher/HTTPResponse.py, for example in the 'write'
method of the HTTPResponse, or by wrapping the 'self.stdout' in __init__
by something that also logs the output before writing to the passed
'stdout' stream. 
 Of course this most probably will bring performance down (or even the
complete Zope, if there is a simple typo in the hacked code ;-) I assume
You only need this for testing.

Cheers,
Clemens