Any way to tell watchdog to ignore certain information?

My database sort of went berserk day (it was a problem with the sessions table, emptying that table seems to have taken care of everything for the moment) and while I was in phpmyadmin trying to clean up the mess I noticed to my chagrin that the watchdog table in mysql was taking up ONE THIRD of the entire database size.

Keep in mind that my site is a webcomic with ten years worth of comic archives.

So I went ahead and cleared that table, and all is dandy... but I was wondering if any of you had any good ideas as to how to handle Watchdog? Most of the time the information is useless to me because the majority of the information it reports is that some site is trying to retrieve graphic files that aren't there. There are a number of sites that download/mirror my comics, and the automation they've set up isn't particularly good -- they're constantly looking for comics that haven't been posted yet. While the most convenient solution (for me) would be for those sites to either improve their image-grabbing bots or stop using them all together, I don't have any control over that.

Is there a way in Drupal to tell it not to log specific kinds of events? I know it's possible to filter them out when you're looking at the watchdog page, but I don't see any obvious way to tell it to ignore specific things. I still want to know when there are database errors and those kinds of things, but seeing what ip address is accessing what content is mostly a useless exercise in my situation, and it's really driving up the size of my database...

Watchdog hook

kbahey - February 14, 2008 - 21:38

With Drupal 6, watchdog is now a hook that can accept logging to any destination, hence bypassing the database entirely.

This allows you to write a module to ignore any level of errors, or change the destination for logging, for example, an email logging module is here http://drupal.org/project/logging_alerts

If you are using Drupal 5.x (most likely) then the patch for it is available here http://drupal.org/node/149341
--
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc.
Personal blog: Baheyeldin.com.

That's it!

ubersoft - February 15, 2008 - 01:37

That looks like exactly the thing I was looking for. Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.