Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Imagecache creates an error log level entry when source file is missing. This log level should be lower, so it's a common situation when a node or source image is deleted o modified, and there are still links to imagecache processed file, like from google images.
This error messages are annoying in special when using logging and alerts module or similar, so the webmaster receives lots of automatic notifications about something that is normal.
Comment | File | Size | Author |
---|---|---|---|
missing_source-notice_loglevel_watchdog.patch | 608 bytes | manuel.adan |
Comments
Comment #1
storytellerjeff CreditAttribution: storytellerjeff commentedThanks for the patch, it does work, but now I have pages of warning messages in my error log.
The messages are 404: Unable to find... but in each case its for a handful of images that I deleted in the past - I deleted both the uploaded image and the imagecache processed file, but am still getting loads of these messages on every cron run (from the boost crawler, I think). I've flushed my caches and flushed the imagecache presets that were being effected and still get warning messages.
I'm happy to hear that this is normal, but is there anyway to get rid of the links to deleted files?
Comment #2
sandrewj CreditAttribution: sandrewj commentedPatch looks good. Could be rerun against dev, but it is only a 6 character patch.
re storytellerjeff: no, some outside source has copied/bookmarked/crawled your images. The same messages would show up if somebody mistyped a path to a preset image.
Comment #3
storytellerjeff CreditAttribution: storytellerjeff commentedre:sandrewj: ah, understood, thanks for the info.
Comment #4
ChrisLaFrancis CreditAttribution: ChrisLaFrancis commentedWas having the same problem and this patch works for me with 6.x-2.x-dev. Thanks.
Comment #5
fizk CreditAttribution: fizk commentedThis really depends on how important it is to you that images are missing.
Since this is a very minor tweak that you could do on your own, I'll leave this as it is.
Comment #6
lambic CreditAttribution: lambic commentedWhat's being reported is basically a 404, so it should be logged in the same way as standard Page Not Found entries, logging it as an error doesn't make sense in most cases.
Comment #7
manuel.adanI'm using logging_alerts module to get notice via e-mail about ERROR or higher severity level log entries, so I have my inbox busy when an image is removed by users, and crawlers try to reach it.
Drupal core registers not found events as NOTICE. An ERROR is something important enough to check and solve, a deleted image is not such. It is not a cosmetic change or something subject to my discretion, each log level has a meaning.
Comment #8
fizk CreditAttribution: fizk commentedMarking as ImageCache 3.x Todo.
Comment #9
ChrisLaFrancis CreditAttribution: ChrisLaFrancis commentedJust to throw my two cents in, I agree with lambic and arcovia in that it seems more consistent with the rest of Drupal to log these missing images as notices instead of errors.
As fizk points out, changing this log level is a trivial patch, so shouldn't it be that the default is consistent (i.e., a notice), and if someone needs it to be an error (I'm sure a minority), they can manually change it from notice to error?