From 4e1901b7c8a2f9789558b8f718f7f42e84749f36 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Mon, 5 May 2025 15:40:05 -0400 Subject: [PATCH] FatalErrors --- app/public/index.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/public/index.php b/app/public/index.php index a7bedad..a7faac5 100644 --- a/app/public/index.php +++ b/app/public/index.php @@ -13,3 +13,10 @@ try { $app->getContainer()->get(Psr\Log\LoggerInterface::class)->notice($exception); header('Location: /construccion'); } +register_shutdown_function(function() { + $error = error_get_last(); + + if ($error !== null) { + error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log'); + } +});