Skip to content

Commit

Permalink
Pass exceptions from the ExceptionListener to Monolog
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude authored and fabpot committed May 10, 2013
1 parent 7fc0768 commit 97bee20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ CHANGELOG
* deprecated `Symfony\Component\HttpKernel\Kernel::init()``
* added the possibility to specify an id an extra attributes to hinclude tags
* added the collect of data if a controller is a Closure in the Request collector
* pass exceptions from the ExceptionListener to the logger using the logging context to allow for more
detailed messages

2.2.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,12 @@ public static function getSubscribedEvents()
protected function logException(\Exception $exception, $message, $original = true)
{
$isCritical = !$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500;
$context = array('exception' => $exception);
if (null !== $this->logger) {
if ($isCritical) {
$this->logger->critical($message);
$this->logger->critical($message, $context);
} else {
$this->logger->error($message);
$this->logger->error($message, $context);
}
} elseif (!$original || $isCritical) {
error_log($message);
Expand Down

0 comments on commit 97bee20

Please sign in to comment.