Looking for a rack middleware to dump http request response traces

I was thinking about writing a rack middleware which would dump each
request and response coming into a server, but I thought that surely
something like that must surely already exist.

I'd like to write somthing like this:

to a log file.

My googling skills are failing me in finding something, before writing
it myself.