not found exception add log

This commit is contained in:
xiaomlove
2023-06-11 14:56:22 +08:00
parent 8e156dcbea
commit 3ffc6aaa36
2 changed files with 3 additions and 2 deletions

View File

@@ -71,7 +71,8 @@ class Handler extends ExceptionHandler
$this->renderable(function (NotFoundHttpException $e) { $this->renderable(function (NotFoundHttpException $e) {
if ($e->getPrevious() && $e->getPrevious() instanceof ModelNotFoundException) { if ($e->getPrevious() && $e->getPrevious() instanceof ModelNotFoundException) {
$exception = $e->getPrevious(); $exception = $e->getPrevious();
return response()->json(fail($exception->getMessage(), request()->all()), 404); do_log(sprintf("NotFoundHttpException: %s, trace: %s", $exception->getMessage(), $exception->getTraceAsString()), 'error');
return response()->json(fail($exception->getMessage(), request()->all()));
} }
}); });
} }

View File

@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.4'); defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.4');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-06-10'); defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-06-11');
defined('IN_TRACKER') || define('IN_TRACKER', false); defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");