How to enable POST request body log in Apache

Bydeafault Apache will not log the POST request body. We can use the dumpio to log the POST request body in Apache.

In Fedora, CentOS and Red Hat systems dumpio module will be enabled bydeafault.

In Debian systems we can use the following command to enable the dumpio module.

#a2enmod dump_io

Then the virtualhost directive need to be updated with the following lines to log the POST request body.

DumpIOInput On
DumpIOOutput On

Set the LogLevel to dumpio:trace7

Restart the Apache service to reload the configuration.

#systemctl restart apache

Now POST request body will be logged to the corresponding access log file.

That's all…

Leave a Reply