Skip to content

Commit

Permalink
pkp#9979 use class name for scheduled task log file name
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Jun 13, 2024
1 parent bcd2f7f commit c1d2b2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/scheduledTask/ScheduledTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1d2b2d

Please sign in to comment.