Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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
share|improve this answer
    
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 '11 at 6:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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