public function onException(GetResponseForExceptionEvent $event)
    {
        if ($event->isMasterRequest()) {
            return;
        }

        $exception = $event->getException();

        $level = LogLevel::CRITICAL;
        if ($exception instanceof HttpExceptionInterface && $exception->getStatusCode() < 500) {
            $level = LogLevel::WARNING;
        }

        $this->logger->log($level, $exception->getMessage(), ['event' => 'exception', 'exception' => $exception]);
    }
public function onException(GetResponseForExceptionEvent $event)
    {
        if ($event->isMasterRequest()) {
            return;
        }

        $exception = $event->getException();

        $level = LogLevel::CRITICAL;
        if ($exception instanceof HttpExceptionInterface && $exception->getStatusCode() < 500) {
            $level = LogLevel::WARNING;
        }

        $this->logger->log($level, $exception->getMessage(), ['event' => 'exception', 'exception' => $exception]);
    }
public function onException ( GetResponseForExceptionEvent $ event ) { if ( $ event -> isMasterRequest ( ) ) { return ; } $ exception = $ event -> getException ( ) ; $ level = LogLevel :: CRITICAL ; if ( $ exception instanceof HttpExceptionInterface && $ exception -> getStatusCode ( ) < 500 ) { $ level = LogLevel :: WARNING ; } $ this -> logger -> log ( $ level , $ exception -> getMessage ( ) , [ 'event' => 'exception' , 'exception' => $ exception ] ) ; }
Log exceptions thrown in the application.

@param GetResponseForExceptionEvent $event
Log exceptions thrown in the application .