Skip to content

Commit

Permalink
TryCatchMiddleware: make log() protected, add exception to monolog co…
Browse files Browse the repository at this point in the history
…ntext
  • Loading branch information
f3l1x committed Feb 23, 2024
1 parent 0d444a4 commit 0b6c80b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TryCatchMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b6c80b

Please sign in to comment.