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]);
    }