Add request/response logging via cherrypy tool hooks
authorJohn Dennis <jdennis@redhat.com>
Tue, 20 Jan 2015 22:13:34 +0000 (17:13 -0500)
committerSimo Sorce <simo@redhat.com>
Mon, 26 Jan 2015 18:34:06 +0000 (13:34 -0500)
commite85f190d8e081fbbfeadca24781266d1c3e1bba1
treeb8cd9287b5a6ea5943d248b75247fc5793f738fe
parent9a941b4aa2e39723d93a37fcb31475c6e9038943
Add request/response logging via cherrypy tool hooks

The ability to easily review the HTTP Ipsilon request and response is
boon for development and issue debugging. Normally these HTTP
conversations occur on SSL/TLS encrypted connections making it
difficult to use other tools to view the traffic. Client side tools
have known pitfalls (e.g. Firebug) and not all conversations are
browser initiated (e.g. SAML ECP). Logging performed by the server
hosting Ipsilon makes logging at the server level server specific
(e.g. Apache's dumpio requires post-processing the log file to extract
and reassamble the HTTP conversation). The best place to log requests
and responses is within Ipsilon using the cherrypy framework
Ipsilon is embedded in. Cherrypy provides user defined hooks that can
be invoked at specific places in the request pipeline. We establish a
hook at the last stage just before the response is written to the
client, it logs the incoming request and outgoing response.

Resolves: https://fedorahosted.org/ipsilon/ticket/44

Signed-off-by: John Dennis <jdennis@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
examples/ipsilon.conf
ipsilon/util/log.py
templates/install/ipsilon.conf