From c1d520f1cfd56b0bc44ebccd1acd158a163ef3ed Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 13 Sep 2021 17:40:39 -0600 Subject: [PATCH] Add date/time to text file output of scheduler --- system/src/Grav/Common/Scheduler/Job.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Scheduler/Job.php b/system/src/Grav/Common/Scheduler/Job.php index f21c26def..94fbaf102 100644 --- a/system/src/Grav/Common/Scheduler/Job.php +++ b/system/src/Grav/Common/Scheduler/Job.php @@ -390,7 +390,9 @@ class Job if (count($this->outputTo) > 0) { foreach ($this->outputTo as $file) { $output_mode = $this->outputMode === 'append' ? FILE_APPEND | LOCK_EX : LOCK_EX; - file_put_contents($file, $this->output, $output_mode); + $timestamp = (new DateTime('now'))->format('c'); + $output = $timestamp . "\n" . str_pad('', strlen($timestamp), '>') . "\n" . $this->output; + file_put_contents($file, $output, $output_mode); } }