Problem/Motivation
When cron logging is enable, each time cron is executed, simple_cron create a warn log "Cron job @job should not be running." for each job that is not executed at this time.
This is not an error even not an info, it's perfectly normal that a job is not executed outside its scheduled time.
It pollutes the logs, specially if cron is run frequently and with a lot of jobs.
Steps to reproduce
- Enable cron logging
- Be sure that at least several cron jobs are scheduled
- Wait to a cron execution
- Parse log, there should be a warning per task that is not executed that says "Cron job @job should not be running."
Proposed resolution
Remove the warning in web/modules/contrib/simple_cron/src/Entity/CronJob.php:312:
if (!$plugin ) {
$this->logger->warning('Cron job @job could not be run: missing plugin.', ['@job' => $this->label()]);
return FALSE;
}
if (!$this->shouldRun($request_time, $force)) {
return FALSE;
}
Comments
Comment #2
o'briatComment #4
o'briatComment #5
ktpm commentedHi, we are using simple cron with the watchdog mailer module because we want to be notified if a cron fails for any reason.
The mailer module sends logs from warning level and anything more severe though.
By removing the warning log this change does work for us. Thanks.
Comment #6
o'briatI mark this issue as RTBTC as it run smoothly on production websites for 4 months
Comment #7
ghaddon commentedPatch from MR above should anyone else need it.
Comment #9
scott_euser commentedYep I agree with this - thanks for fixing it! Will just let the pipeline run and see if any corresponding test updates are needed
Comment #11
scott_euser commented