> Shawn wrote:
> > It seems as if tools.log_headers only works for error conditions.
> > I'm doing this for my app:
> > cherrypy.config.update({
> > "tools.log_headers.on": True
> > })
> > However, I'm not seeing headers going to the log for every request.
> > A further glance reveals that it is only hooked to
> > before_error_response:
> > _d.log_headers = Tool('before_error_response',
> > cptools.log_request_headers)
> > Changing _cptools.py to:
> > _d.log_headers = Tool('on_start_resource',
> > cptools.log_request_headers)
> > ...seems to do the trick, but this seems wrong.
> >http://www.cherrypy.org/wiki/BuiltinToolssays:
> > tools.log_headers
> > When enabled, the headers of every request will be sent to CherryPy's
> > log.
> > Have I missed something?
> All I can say is, "it's always been on-error only". I've updated the
> wiki page. You're certainly welcome to run the log_request_headers
> function at a different hookpoint--this is one of the strengths of the
> hook and tool system, not wrong at all! I'd just recommend you make a
> new Tool for yourself instead of monkeypatching:
> cherrypy.tools.log_all_headers = cherrypy.Tool(
> 'on_start_resource', cptools.log_request_headers)