Mobile app version of vmapp.org
Login or Join
Alves908

: Apache logging based on user agent 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

@Alves908

Posted in: #Apache #ApacheLogFiles #Logging #UserAgent

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

1 Comments

Sorted by latest first Latest Oldest Best

 

@Moriarity557

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme