I recently replaced Google Analytics by the self-hosted analytics tool Piwik.
This means that every time someone connects my website http://www.mywebsite.com, a Javascript tracking code is executed on the client, that calls my Piwik server http://www.mywebsite.com/piwik/piwik.php
Result:
access.log, there is a line about http://www.mywebsite.com, that's normalaccess.log, there is a line about the fact my Piwik server received a tracking request (executed by client with JS)The logging part 3. is clearly too much!
From now, since Piwik in installed, my access.log is double sized!
How to remove the fact that Apache logs in access.log the connection to http://www.mywebsite.com/piwik/piwik.php ? i.e. client JS tracking code <--> Piwik server ?
The solution is to disable logging of certain requests (for example in 
/etc/apache2/sites-available/000-default.conf with Debian 8):
<VirtualHost *:80>
  ServerName www.mywebsite.com
  DocumentRoot /home/www/mywebsite
  ...
  SetEnvIf Request_URI "^/piwik(.*)$" dontlog
  CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined env=!dontlog
</VirtualHost>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With