Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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? modsecurity.org/documentation/modsecurity-apache/1.9.3/… 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.