Is there any way to disable the 'Cron run completed.' log entries? I searched the forums and found there was a solution for Drupal 4, but I don't see anything beyond that.

Comments

thekevinday’s picture

I was looking at this myself.

A quick fix for yourself would be to search the files for the string "Cron run completed" and comment out that line.

In drupal 6.x, it is in the file includes/common.inc on line 2651.

The line of code looks like: watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);

Heres my drupal-6.x patch:

--- drupal-6.12/includes/common.inc.orig        2009-05-18 13:01:36.000000000 -0500
+++ drupal-6.12/includes/common.inc     2009-05-18 13:01:46.000000000 -0500
@@ -2648,7 +2648,7 @@

     // Record cron time
     variable_set('cron_last', time());
-    watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);
+    //watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);

     // Release cron semaphore
     variable_del('cron_semaphore');

I decided to do a quick look, the drupal 5 seems to be pretty easy to find and fix as well.
Heres a drupal-5.x patch

--- drupal-5.18/includes/common.inc.orig        2009-05-18 13:07:01.000000000 -0500
+++ drupal-5.18/includes/common.inc     2009-05-18 13:07:08.000000000 -0500
@@ -2155,7 +2155,7 @@
 
     // Record cron time
     variable_set('cron_last', time());
-    watchdog('cron', t('Cron run completed.'), WATCHDOG_NOTICE);
+    //watchdog('cron', t('Cron run completed.'), WATCHDOG_NOTICE);
 
     // Release cron semaphore
     variable_del('cron_semaphore');

For me, the cron was flooding the logs because I have to do cron runs every single minute, which causes all useful logs to be hard to find and the log buffer to become full very quickly.

Krythis’s picture

Worked great, thanks for the followup!