Simple cron log should not log non scheduled jobs.

Created on 24 August 2023, over 1 year ago

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;
}
🐛 Bug report
Status

Needs work

Version

1.1

Component

Code

Created by

🇫🇷France o'briat Nantes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024