Proxy logging

When nginx is used as a proxy, is it possible to log the complete http
request (headers + body) of both the request and proxied response?

The end goal is to log these values into a database. If I was able to
shoot a “copy” off each request to a logging service that would be
ideal. Are there possibilites otherwise?

Any insight is greatly appreciated.

Posted at Nginx Forum: