Possible to log POST / GET params in Apache 2.2

Is it possible to adjust Apache config somehow to log POST / GET parameters?

For example, this is what it currently logs:

174.131.xx.xxx - - [30/Apr/2013:08:41:59 -0500] "POST /admin/bl_orderItem.php HTTP/1.1" 200 44

I would like to achiev something like this to be seen in logs:

174.131.xx.xxx - - [30/Apr/2013:08:41:59 -0500] "POST /admin/bl_orderItem.php?name=John&lastName=Rambo&zip=12331 HTTP/1.1" 200 44

Thank you for all suggestions.


Solution 1:

In a custom log format %r (first line of request) will contain the GET parameters. For just the GET params use %q (query string (prepended with a ? if a query string exists, otherwise an empty string)).

See http://httpd.apache.org/docs/2.4/mod/mod_log_config.html#formats

For the post data you have to use mod_dumpio.

See http://httpd.apache.org/docs/2.4/mod/mod_dumpio.html

Solution 2:

You also might want to look at mod_security module to do this. It's really great at logging all params (in and out).