From: Eileen McNaughton Date: Tue, 7 Nov 2023 03:19:58 +0000 (+1300) Subject: Include exception, separator text in details send to log X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=91c7b37d222cee08c4576960e3322f2da5b9bdf5;p=civicrm-core.git Include exception, separator text in details send to log --- 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;