diff --git a/src/TryCatchMiddleware.php b/src/TryCatchMiddleware.php index 56481fc..d82d89b 100644 --- a/src/TryCatchMiddleware.php +++ b/src/TryCatchMiddleware.php @@ -35,13 +35,13 @@ public function setLogger(LoggerInterface $logger, string $logLevel = LogLevel:: $this->logLevel = $logLevel; } - private function log(Throwable $throwable): void + protected function log(Throwable $throwable): void { if ($this->logger === null) { return; } - $this->logger->log($this->logLevel, $throwable->getMessage()); + $this->logger->log($this->logLevel, $throwable->getMessage(), ['exception' => $throwable]); } public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface