Logs an exception.
\Exception $exception The original \Exception instance:
string $message The error message to log:
Boolean $original False when the handling of the exception thrown another exception:
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, $context);
}
else {
$this->logger
->error($message, $context);
}
}
elseif (!$original || $isCritical) {
error_log($message);
}
}