Results 1 to 5 of 5
Thread: Apache2 Conditional Logging
Threaded View
-
03-20-2011, 04:12 AM #1Newbie
- Join Date
- Jan 2005
- Posts
- 11
Apache2 Conditional Logging
I want to do some conditional logging in Apache 2
1. Remove any reference to robots.txt
2. Don't log picture GETS at all
3. Don't log 4 IP's which are admins (hundreds of log entries - just unnecessary)
Not that it's specially relevant, this apache2 setup hosts a wordpress blog, and I'm trying to think down the logs just a little bit for the sake of readability.
After a massive amount of Googling over the past couple of days, I've come up with what I THINK are solutions to the above, but I have no idea how to combine them.
1.
##Don't want any mention of robots.txt in logfiles
SetEnvIf Request_URI "^/robots\.txt$" dontlog
CustomLog /var/log/apache2/access.log combined env=!dontlog
2.
## Don't want thousands of "pointless" image requests
SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
CustomLog /path/to/log/access.log env=!image-request
3.
## It seems as if I can't *eliminate* admin IP addy's so les's toss 'em in a "local" logfile
SetEnvIf Remote_Addr "192\.168\.1\." local
SetEnvIf Remote_Addr "10\.1\.1\." local
SetEnvIf Remote_Addr "1\.2\3\.44" local
CustomLog /path/to/log/local.log common env=!local
CustomLog /path/to/log/access.log common env=!local
Could some wise eyes take a look at the above - and - of equal importance, tell me if (or how) I can combine these directives within one conf file? OR should I "Include" these as modular external files (which seems a "cleaner" solution somehow) if so, how?
Regards & TIA for any suggestsions & guidance.
CJR
Similar Threads
-
Conditional WordPress Plugin
By ljhsdfbu86sd43t in forum Web Design and ContentReplies: 0Last Post: 10-26-2010, 12:55 PM -
jquery conditional problem
By Satch in forum Programming DiscussionReplies: 2Last Post: 08-26-2008, 09:20 AM -
php conditional loop help needed
By tonomud in forum Programming DiscussionReplies: 10Last Post: 12-28-2005, 10:27 AM -
Conditional SSI
By Cyberpunk in forum Web Hosting LoungeReplies: 2Last Post: 09-19-2001, 08:14 PM -
Raq4 stopped logging (plus other logging questions)
By Addict in forum Dedicated ServerReplies: 3Last Post: 08-27-2001, 10:29 AM