private function logFatalError() { register_shutdown_function(function () { $error = error_get_last(); switch ($error['type']) { case E_ERROR: case E_PARSE: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: LoggerUtil::fatal(json_encode($error, JSON_UNESCAPED_UNICODE)); } }); }