Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to log response body in Apache 2?

I need the exact content that will be sent to user browser.

I tried mod_security audit logging, but it won't log response body for all requests.

(I got confused really. It logs response body for requesting a simple PHP page in a directory, but it won't log response body for another file in another directory. It just log response and request header.)

Update: here is mod_security configuration in main configuration file (httpd.conf):

SecAuditEngine On
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess On
SecAuditLogParts ABCDEFGHZ
SecAuditLog logs/sec.log
share|improve this question
Did you see this?… Note the example configuration. – Jonathan Ben-Avraham Apr 2 '13 at 1:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.