I achieve this by making the log dependent on a non-existent environment variable. So in .htaccess
or VirtualHost
you can:
CustomLog /var/log/httpd/my_access_log combined env=DISABLED
and as long as there is no environment variable called DISABLED
, then you will not get any logs.
I really came here to find a tidier solution, but this works without modifying the global httpd.conf
.
source share