0
votes

My logs are full with:

2011-04-22 13:30:02.251 /soc/content/images/melange-logo.jpg 404 0ms 0cpu_ms 0kb facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php),gzip(gfe),gzip(gfe),gzip(gfe) 69.171.224.250 - - [22/Apr/2011:13:30:02 -0700] "GET /soc/content/images/melange-logo.jpg HTTP/1.1" 404 0 - "facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php),gzip(gfe),gzip(gfe),gzip(gfe)" "www.google-melange.com" ms=1 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000036 W 2011-04-22 13:30:02.250 Static file referenced by handler not found: soc/content/melange-logo.jpg

This is a known 404, we changed our url schema and that link isn't used anymore. I'm fine with it serving a 404. What I'm not fine with is the warning in my logs every time Facebook's bot hits that url, which it does about every 5 minutes, polluting my logs.

How can I get rid of this annoying warning?

app.yaml is at:

http://code.google.com/p/soc/source/browse/app/app.yaml.template

1
Why not disallow that particular file in your robots.txt?Kevin P
A don't mean to be snarky, but might it just be easier to add that one URL back to your application for "legacy" support? I suppose you could also write a custom handler for that URL that doesn't return an error code.Justin Morgan
I suppose that's an option, but not really an answer to my question. The main thing that bothers me is that some one can spam my logs just by visiting random urls that happen to match my static file regexp.Sverre Rabbelier
Isn't the risk of spam in your logs outweighed by the benefits of seeing actual or potential site problems reflected in the log? If someone is spamming you maliciously, use the blacklist tool. Otherwise, I would say those logs are a good thing. You can always download the logs and parse out the noise.Justin Morgan

1 Answers

2
votes

You could modify the regular expression for your static file to not match that specific filename. Alternately, provide a dynamic handler that returns a 404 for that path but doesn't log anything. Or, just re-upload the file.