Under certain circumstances (rare, opt-in ones) I want to be able to log the contents of an OutputStreamResponse.
Currently I log requests/responses in LiftRules.onEndServicing.
The approach I considered was to copy the OutputStream into memory, log it, then create a new InMemoryResponse to send to the client.
However onEndServicing doesn't have any control over what is actually sent to the client, so I suspect the OutputStream will return nothing to the client if it is already "evaluated".
Has anyone done this, is there a part of the LiftRules API I'm missing?
Thanks,
Dan