watchdog_cron

Versions
4.6 – 5
watchdog_cron()

Implementation of hook_cron().

Remove expired log messages and flood control events.

Code

modules/watchdog/watchdog.module, line 67

<?php
function watchdog_cron() {
  db_query('DELETE FROM {watchdog} WHERE timestamp < %d', time() - variable_get('watchdog_clear', 604800));
  db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.