Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Cron currently logs its results as notices:
$this->logger->notice('Cron run completed.');
$logger->notice('Starting execution of @module_cron().', [
$logger->notice('Starting execution of @module_cron(), execution of @module_previous_cron() took @time.', [
$logger->notice('Execution of @module_previous_cron() took @time.', [
The RFC says this is for "significant" conditions (Wikipedia says "events that are unusual but not error conditions").
I think the Informational level would be more appropriate here, since the cron run is a routine event that doesn't normally require attention.
Comment | File | Size | Author |
---|---|---|---|
#13 | drupal-cron-2863464-13.patch | 1.63 KB | efpapado |
#2 | drupal-cron-2863464-2.patch | 1.97 KB | cburschka |
Comments
Comment #2
cburschkaComment #9
efpapado CreditAttribution: efpapado as a volunteer commentedRe-roll for D9-beta2.
Comment #11
efpapado CreditAttribution: efpapado as a volunteer commentedFailing tests seem to pass on second iteration.
Comment #12
longwaveThis only changes one of the messages, the original patch changed four messages.
I would go so far to argue that "Starting execution" is not even informational, debug level at best, but downgrading it to info is a good start.
Comment #13
efpapado CreditAttribution: efpapado as a volunteer commentedAgree in both, new patch attached.
Comment #15
lhridley CreditAttribution: lhridley as a volunteer and commentedOh, I was just asking the question in Drupal #support on the rationale behind logging the very cron messages that this patch addresses as Notices and not Info messages.
Applied and tested, Working as designed. Thanks for this!
Marking RTBC!
Comment #17
catchCommitted 6f4c546 and pushed to 9.2.x. Thanks!