A little bit of googling showed me the following result:
Per status code differentiation
We all like HTTP status 200. It means 'OK' and that's why we're not interested in loging it. Most common situation is when we are looking for some specific status code in the logs. With mod_log_config
you may create separate logs for every needed status. Please look at this configuration:
CustomLog ok.log "%200t %200a,%200{User-Agent}i %200U%200q %200s"
CustomLog redirections.log "%301t %301a,%301{User-Agent}i %301U%301q %301s"
CustomLog not_found.log "%404t %404a,%404{User-Agent}i %404U%404q %404s"
CustomLog server_error.log "%500t %500a,%500{User-Agent}i %500U%500q %500s"
It contains a link to this website.
Edit:
The (current) documentation of mod_log_config
shows options for matching status codes:
Particular items can be restricted to print only for responses with specific HTTP status codes by placing a comma-separated list of status codes immediately following the "%". The status code list may be preceded by a "!" to indicate negation.
So I suggest you read through that page and configure CustomLog
configurations that suit your needs. I would start with trying something like:
CustomLog /dev/null "%200"
Though the file name must be relative to the ServerRoot
so some trickery will be required there. Perhaps check some chroot
documentation on how to copy the file /dev/null to inside your ServerRoot
.