From 91c7b37d222cee08c4576960e3322f2da5b9bdf5 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 7 Nov 2023 16:19:58 +1300 Subject: [PATCH] Include exception, separator text in details send to log --- CRM/Queue/TaskRunner.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Queue/TaskRunner.php b/CRM/Queue/TaskRunner.php index 8c42ab8425..7f1d03c879 100644 --- a/CRM/Queue/TaskRunner.php +++ b/CRM/Queue/TaskRunner.php @@ -40,12 +40,12 @@ class CRM_Queue_TaskRunner { /** @var string $outcome One of 'ok', 'retry', 'delete', 'abort' */ if (is_numeric($queue->getSpec('retry_limit')) && $item->run_count > 1 + $queue->getSpec('retry_limit')) { - \Civi::log()->debug("Skipping exhausted task: " . $task->title); + \Civi::log()->debug('Skipping exhausted task: ' . $task->title); $outcome = $queue->getSpec('error'); $exception = new \CRM_Core_Exception(sprintf('Skipping exhausted task after %d tries: %s', $item->run_count, print_r($task, 1)), 'queue_retry_exhausted'); } else { - \Civi::log()->debug("Running task: " . $task->title); + \Civi::log()->debug('Running task: ' . $task->title); try { $runResult = $task->run($this->createContext($queue)); $outcome = $runResult ? 'ok' : $queue->getSpec('error'); @@ -80,17 +80,17 @@ class CRM_Queue_TaskRunner { switch ($outcome) { case 'retry': - \Civi::log('queue')->error('Task "{id}" failed and should be retried. {message}', $logDetails); + \Civi::log('queue')->error('Task "{id}" failed and should be retried. Task specific error: {message}', $logDetails); $queue->releaseItem($item); break; case 'delete': - \Civi::log('queue')->error('Task "{id}" failed and will be deleted. {message}', $logDetails); + \Civi::log('queue')->error('Task "{id}" failed and will be deleted. Task specific error: {message}', $logDetails); $queue->deleteItem($item); break; case 'abort': - \Civi::log('queue')->error('Task "{id}" failed. Queue processing aborted. {message}', $logDetails); + \Civi::log('queue')->error('Task "{id}" failed. Queue processing aborted. Task specific error: {message}', $logDetails); $queue->setStatus('aborted'); $queue->releaseItem($item); /* Sysadmin might inspect, fix, and then resume. Item should be accessible. */ break; -- 2.25.1