Commit 80f0abd6 authored by Fabien Potencier's avatar Fabien Potencier

merged branch fabpot/monolog-exceptions (PR #670)

This PR was merged into the master branch.

Discussion
----------

added exception in the Monolog context when appropriate (closes #613, closes #614)

Added support for PSR-3 logging and the special exception key.

Commits
-------

973ee703 added exception in the Monolog context when appropriate (closes #613, closes #614)
parents 31139bab 973ee703
......@@ -73,9 +73,9 @@ class MonologServiceProvider implements ServiceProviderInterface
$app->error(function (\Exception $e) use ($app) {
$message = sprintf('%s: %s (uncaught exception) at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine());
if ($e instanceof HttpExceptionInterface && $e->getStatusCode() < 500) {
$app['monolog']->addError($message);
$app['monolog']->addError($message, array('exception' => $e));
} else {
$app['monolog']->addCritical($message);
$app['monolog']->addCritical($message, array('exception' => $e));
}
}, 255);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment