You are here

function _log_cleanup_main in Util 6.3

Same name and namespace in other branches
  1. 7 contribs/log_cleanup/log_cleanup.module \_log_cleanup_main()

Clean up requested rows from watchdog. Default interval (259200) is 72 hours (3 days).

1 call to _log_cleanup_main()
log_cleanup_cron in contribs/log_cleanup/log_cleanup.module
Implementation of hook_cron(). Clean up a few things from watchdog.

File

contribs/log_cleanup/log_cleanup.module, line 13
Clean up watchdog messages.

Code

function _log_cleanup_main($type, $interval = LOG_CLEANUP_DEFAULT_INTERVAL) {
  $query = "DELETE FROM {watchdog} WHERE type = '%s' AND timestamp < %d";

  // Do it to stuff more than 3 days old.
  $result = db_query($query, $type, time() - $interval);
  return db_affected_rows();
}