Log solo los errores fatales.

This commit is contained in:
Juan Pablo Vial
2025-05-07 20:01:55 -04:00
parent 878b02ee52
commit 8be5f94b7c

View File

@ -16,7 +16,8 @@ try {
register_shutdown_function(function() { register_shutdown_function(function() {
$error = error_get_last(); $error = error_get_last();
if ($error !== null) { $fatal_errors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
if ($error !== null and in_array($error['type'], $fatal_errors, true)) {
error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log'); error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log');
} }
}); });