Skip to content

Instantly share code, notes, and snippets.

@dimitri-koenig
Created November 16, 2016 14:59
Show Gist options
  • Save dimitri-koenig/ea461594d4e99e945d9f179c8ebcc243 to your computer and use it in GitHub Desktop.
Save dimitri-koenig/ea461594d4e99e945d9f179c8ebcc243 to your computer and use it in GitHub Desktop.
Filtered apache logs
SetEnvIfNoCase Request_URI "(specialRequest\/call|\.(jpg|jpeg|xml|png|gif|ico|js|css|swf|eot|ttf|woff|woff2))" DontLog
SetEnvIfNoCase User-Agent (crawler|bot|spider|yahoo|slurp|ltx71|statuscake) DontLog
SetEnvIf Request_URI "specialRequest\/call" specialRequestLog
SetEnvIfNoCase User-Agent (crawler|bot|spider|yahoo|slurp|ltx71|statuscake) bot
CustomLog /var/www/project/static/log/access.log combined Env=!DontLog
CustomLog /var/www/project/static/log/access-specialRequest.log combined Env=specialRequestLog
CustomLog /var/www/project/static/log/access-bot.log combined Env=bot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment