I'd like to update my apache logging so that its destination is based on the user agent string or file type.

Specifically, I would like to send my googlebot requests to their own log file, and I would like to not log requests for any of my image files.

My configuration is pretty much stock.

1 Answer 1


Try adding something like the following into your VirtualHost config:

SetEnvIf User-agent .*Googlebot.* googlebot
CustomLog /var/log/apache2/access_googlebot.log combined env=googlebot
CustomLog /var/log/apache2/access.log combined env=!googlebot
  • In reference to the reply by Ewan, When you refer to VirtualHost config would that be the apache2.conf, the httpd.conf, or other file?
    – user10891
    Oct 17, 2011 at 6:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.