You are here

protected function ExceptionListener::logException in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/EventListener/ExceptionListener.php \Symfony\Component\HttpKernel\EventListener\ExceptionListener::logException()

Logs an exception.

Parameters

\Exception $exception The \Exception instance:

string $message The error message to log:

1 call to ExceptionListener::logException()
ExceptionListener::onKernelException in vendor/symfony/http-kernel/EventListener/ExceptionListener.php

File

vendor/symfony/http-kernel/EventListener/ExceptionListener.php, line 85

Class

ExceptionListener
ExceptionListener.

Namespace

Symfony\Component\HttpKernel\EventListener

Code

protected function logException(\Exception $exception, $message) {
  if (null !== $this->logger) {
    if (!$exception instanceof HttpExceptionInterface || $exception
      ->getStatusCode() >= 500) {
      $this->logger
        ->critical($message, array(
        'exception' => $exception,
      ));
    }
    else {
      $this->logger
        ->error($message, array(
        'exception' => $exception,
      ));
    }
  }
}