Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.27
-
Fix Version/s: 5.4
-
Component/s: Core CiviCRM
-
Labels:
-
Versioning Impact:Minor (add functionality in backwards-compatible manner)
-
Documentation Required?:Developer Doc
-
Funding Source:Contributed Code
-
Verified?:No
Description
It would be useful to know the result of the execution of a scheduled job in a programmatic manner, for example to display all the jobs that failed previous night, or send an alert when some job fails. At the moment the job log does not store any structured information about the execution status, only a message in a freetext format.
I think the easiest and most flexible solution would be to add a hook after the execution of the job, e.g.: hook_civicrm_postExecute($job, $result).
I am happy to write the code and PR, but would love some feedback on whether this is the best direction to take.