I want to be able to log HTTP request and response in tornado. This seems to be easy to do with request:
def log_function(handler):
info = {
'Method' : handler.request.method,
'Host' : handler.request.host,
'URL' : handler.request.uri
}
How can the same thing be achieved for response? The response status_code can be retrieved by calling
handler.get_status()
How do I get a body of a response?