Improved logging.

I want the ability to turn on logging for a request via a request
parameter for development, and get the results of the log returned as
part of the payload.