Using Apache 2.4, I am trying to create a custom log file format which will only log out page views, instead of all request resources (images, css, etc).

The site is built using PHP and therefore the document Content-Type is text/html.

I thought I could just simply do this in my apache conf file:-

SetEnvIf   Content-Type  "text/html" pagelog
CustomLog "/var/logs/mycustompagelog.log" combined env=pagelog

However, this doesn't log out anything, because the Content-Type is part of the Response, not the Request. Is it possible to log out based on the Request headers? How can this be done?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.