diff --git a/composer.json b/composer.json index 7c167bb..79ec4d8 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "ext-json": "*", "guzzlehttp/guzzle": "^6.1 || ^7.0.1", "guzzlehttp/psr7": "^1.7 || ^2.0", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "require-dev": { "phpstan/phpstan": "~0.12.32", diff --git a/src/Handler/StringHandler.php b/src/Handler/StringHandler.php index 09607a1..e15d30b 100644 --- a/src/Handler/StringHandler.php +++ b/src/Handler/StringHandler.php @@ -53,7 +53,7 @@ private function logRequest(LoggerInterface $logger, RequestInterface $value, ar return; } - $str = \GuzzleHttp\Psr7\str($value); + $str = \GuzzleHttp\Psr7\Message::toString($value); $level = $this->logLevelStrategy->getLevel($value, $options); $logger->log($level, 'Guzzle HTTP request:' . "\n" . $str); @@ -67,7 +67,7 @@ private function logResponse(LoggerInterface $logger, ResponseInterface $value, return; } - $str = \GuzzleHttp\Psr7\str($value); + $str = \GuzzleHttp\Psr7\Message::toString($value); $level = $this->logLevelStrategy->getLevel($value, $options); $logger->log($level, 'Guzzle HTTP response:' . "\n" . $str);