# Log POST data to file for debugging

**URL:** <https://www.ruby-forum.com/t/log-post-data-to-file-for-debugging/193044>\
**Category:** NGINX\
**Created:** [August 10, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/log-post-data-to-file-for-debugging/193044 "2010-08-10T12:40:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_Barton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@Dave\_Barton](https://www.ruby-forum.com/u/Dave_Barton)\
**Post date:** [August 10, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/log-post-data-to-file-for-debugging/193044/1 "2010-08-10T12:40:00Z")

</div>

Hi,

We have an issue with some software in the field which makes requests  
back to our webservers. We need to log the IP of each request, the  
referrer string and the POST data. Standard logs take care of the first  
two, but how can I write out the POST data as well?

Some research suggests that I can use the $request\_body to grab this  
information, but I’m not sure when it’s populated/flushed and also  
whether I can write out directly from nginx or whether I need a custom  
module.

I’m using nginx 0.7.64 on Gentoo (amd64) with 2.6.21-xen kernel.

Any help would be greatly appreciated 😃

Dave
