I need to log POST data.
I have added to my config
location / {
echo_read_request_body;
access_log /var/log/nginx/domains/site.post.log postdata;
}
And also added this to http
section
log_format postdata '$time_local $request_body';
But in my log I can see only local time and dash:
23/Jul/2016:16:07:49 +0000 -
What's the problem?
Best Answer
I was having the same problem: no post data were being logged. I fixed my problem by ensuring the endpoint returned something. The following worked for me:
The key is:
default_type
echo