Skip to content

Commit 6528853

Browse files
author
Dayson Pais
committed
More verbose logging if a Job throws an exception
Presently, the logger just logs the primary error message with no stack trace of additional debugging information. Type casting the exception to a string gives a much efficient output and enables better debugging.
1 parent 610c4dc commit 6528853

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Resque/Worker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function perform(Resque_Job $job)
241241
$job->perform();
242242
}
243243
catch(Exception $e) {
244-
$this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {stack}', array('job' => $job, 'stack' => $e->getMessage()));
244+
g $this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {stack}', array('job' => $job, 'stack' => (string)$e);
245245
$job->fail($e);
246246
return;
247247
}

0 commit comments

Comments
 (0)