diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2026-04-14 16:33:04 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2026-04-14 16:33:04 +0200 |
| commit | f3202403339e94f0186b9ff19e83c7a32fdad198 (patch) | |
| tree | c3310b1f456f12a7a92f51948d9c8caf94f11032 /src/Support/Logger.php | |
| parent | 875b9ece501de5937993c41a83c44f8ea59897d0 (diff) | |
implementing against Cinny and iamb some more
Diffstat (limited to 'src/Support/Logger.php')
| -rw-r--r-- | src/Support/Logger.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Support/Logger.php b/src/Support/Logger.php index b01af11..2712a6e 100644 --- a/src/Support/Logger.php +++ b/src/Support/Logger.php @@ -4,6 +4,7 @@ namespace App\Support; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; class Logger implements LoggerInterface { @@ -28,6 +29,16 @@ class Logger implements LoggerInterface ); } + public static function logResponseToFile(Request $request, Response $response): void + { + $basePath = dirname(dirname(__DIR__)) . "/.cache/log/" . str_replace("/", "_", $request->getPathInfo()); + + file_put_contents( + $basePath . "-response.json", + json_encode(json_decode($response->getContent()), JSON_PRETTY_PRINT) + ); + } + public function emergency($message, array $context = []): void { } |
