homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

My log fills up with jpg requests

 4:52 pm on Mar 30, 2005 (gmt 0)

My website hosts a lot of images. Does it make sense to issue this statement in my httpd.conf file?

SetEnvIf Request_URI "\.jpg$" dontlog

I can't see any reason why I need to log these for security purposes. Can you?



 8:55 pm on Mar 30, 2005 (gmt 0)

That depends on whether you occasionally scan your logs (or stats) for evidence of hotlinking -- people putting image links on their Websites that cause their visitors browsers to fetch the images from your server. If this is not a concern, then you might want to disable logging for image requests.



 9:15 pm on Mar 30, 2005 (gmt 0)

Ahhh....good point. I'll keep that one in mind.


 10:19 pm on Mar 30, 2005 (gmt 0)

Personally I use:

<FilesMatch "(\.(gif¦jpg¦png¦ico¦css¦js)¦robots\.txt)$">
SetEnv image-request 1
SetEnv dont-log 1
CustomLog logs/access.log complete env=!dont-log

Does setting "dontlog" instead of my own "dont-log" mean u can skip the "env=" parameter for CustomLog?



 10:20 pm on Mar 30, 2005 (gmt 0)

Also matters for things link hitcount (or bytecount) tracking. If you don't log those requests, you can't track them at all; you can't see which images are getting hit hard, and figuring out how much traffic you're pushing in a day becomes tricky (to say the least). If these aren't issues, then by all means, look into not logging. Me, I log every request, even on the sites where I need to roll/compress my logs multiple times per day to keep things running smoothly. =)


 5:28 pm on Mar 31, 2005 (gmt 0)

I don't log image requests unless they have an off-site referrer.
<Files ~ "\.(gif¦jpe?g¦png¦ico)$"> 
SetEnvIf intra_site_referral 1 common_image_request
CustomLog access_log combined env=!common_image_request

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved