Log more from exception. #37

Merged
aldarien merged 1 commits from feature/better-logging-in-queue into develop 2025-09-15 14:41:23 -03:00

View File

@ -68,12 +68,24 @@ class Queue extends Ideal\Service
return false;
}
} catch (Exception $exception) {
$this->logger->warning("Could not run job {$job->id}", ['exception' => $exception]);
$this->logger->warning("Could not run job {$job->id}", ['exception' => [
'code' => $exception->getCode(),
'message' => $exception->getMessage(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => $exception->getTraceAsString(),
]]);
$job->retries++;
try {
$this->jobService->update($job);
} catch (Update $exception) {
$this->logger->error($exception->getMessage(), ['job' => $job, 'exception' => $exception]);
$this->logger->error($exception->getMessage(), ['job' => $job, 'exception' => [
'code' => $exception->getCode(),
'message' => $exception->getMessage(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => $exception->getTraceAsString(),
]]);
}
return false;
}