You are here

function _log_cleanup_main in Util 7

Same name and namespace in other branches
  1. 6.3 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) {

  // Delete stuff more than specified age.
  $result = db_delete('watchdog')
    ->condition('type', $type)
    ->condition('timestamp', REQUEST_TIME - $interval, '<')
    ->execute();
  return $result;
}