From c1d2b2dca135f19242a16118a76d4cbc8350687e Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Wed, 12 Jun 2024 14:52:50 +0200 Subject: [PATCH] pkp/pkp-lib#9979 use class name for scheduled task log file name --- classes/scheduledTask/ScheduledTask.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/scheduledTask/ScheduledTask.php b/classes/scheduledTask/ScheduledTask.php index ef1e2bb4c6b..8683324be4b 100644 --- a/classes/scheduledTask/ScheduledTask.php +++ b/classes/scheduledTask/ScheduledTask.php @@ -52,7 +52,8 @@ public function __construct($args = []) $fileMgr = new PrivateFileManager(); $scheduledTaskFilesPath = realpath($fileMgr->getBasePath()) . '/' . ScheduledTaskHelper::SCHEDULED_TASK_EXECUTION_LOG_DIR; - $this->_executionLogFile = "{$scheduledTaskFilesPath}/" . str_replace(' ', '', $this->getName()) . + $classNameParts = explode('\\', $this::class); // Separate namespace info from class name + $this->_executionLogFile = "{$scheduledTaskFilesPath}/" . end($classNameParts) . '-' . $this->getProcessId() . '-' . date('Ymd') . '.log'; if (!$fileMgr->fileExists($scheduledTaskFilesPath, 'dir')) { $success = $fileMgr->mkdirtree($scheduledTaskFilesPath);