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.
This commit is contained in:
Dayson Pais 2014-05-26 17:16:19 +05:30
parent 610c4dcdbf
commit 65288538e3

View File

@ -241,7 +241,7 @@ class Resque_Worker
$job->perform();
}
catch(Exception $e) {
$this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {stack}', array('job' => $job, 'stack' => $e->getMessage()));
g $this->logger->log(Psr\Log\LogLevel::CRITICAL, '{job} has failed {stack}', array('job' => $job, 'stack' => (string)$e);
$job->fail($e);
return;
}