How can I log the response header and body in apache?

Posted by acme on Server Fault See other posts from Server Fault or by acme
Published on 2010-12-21T11:04:24Z Indexed on 2010/12/21 11:55 UTC
Read the original article Hit count: 148

Filed under:
|
|
|

I need to determine whether the server (Apache 2) is returning the full contents of a page along with its correct header or not. I have a PHP-script that is executed successfully, but the browser is getting only half of the html content, it's simply cut off.

The client infrastructure is pretty complicated, using Novell BorderManager Proxys and stuff. To ensure the server is doing its job fine I want to log both header and body of the reponse.

How can I achieve this? I looked into the mod_log_config module of apache (which is already installed and ready to be used), but honestly I didn't quite manage to configure it to output header and body somewhere.

edit: I managed to log the header with

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{HEADER_NAME}o\"" common2

CustomLog /var/log/apache2/response.log common2

But unfortunately the mod_log_config formats don't support the whole content body.

Can anyone help?

© Server Fault or respective owner

Related posts about apache

Related posts about logging