diff --git a/api/public/index.php b/api/public/index.php index 9659116..9e2bc0e 100644 --- a/api/public/index.php +++ b/api/public/index.php @@ -8,6 +8,11 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e); + $logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class); + if (isset($_REQUEST)) { + $logger->debug(Safe\json_encode(compact('_REQUEST'))); + } + $logger->debug(Safe\json_encode(compact('_SERVER'))); + $logger->error($e); throw $e; } diff --git a/cli/public/index.php b/cli/public/index.php index aed6193..63341a5 100644 --- a/cli/public/index.php +++ b/cli/public/index.php @@ -8,6 +8,8 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { - $app->getContainer()->get(\Psr\Log\LoggerInterface::class)->error($e); + $logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class); + $logger->debug(Safe\json_encode(compact('_SERVER'))); + $logger->error($e); throw $e; } diff --git a/ui/public/index.php b/ui/public/index.php index 7ef5588..9e2bc0e 100644 --- a/ui/public/index.php +++ b/ui/public/index.php @@ -8,9 +8,11 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface try { $app->run(); } catch (Error | Exception $e) { + $logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class); if (isset($_REQUEST)) { - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->debug(json_encode(compact('_REQUEST'))); + $logger->debug(Safe\json_encode(compact('_REQUEST'))); } - $app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e); + $logger->debug(Safe\json_encode(compact('_SERVER'))); + $logger->error($e); throw $e; }