Why Laravel still logging a NotFoundHttpException while all routes works?

混江龙づ霸主 提交于 2019-12-04 08:23:23
Justin

This had nothing to with NGINX config.

The path to the favicon was incorrect. I assumed all resources were found because in the web inspector everything was status OK or 304. I guess the inspector doesn't show the favicon in the network tab.

As Rubens Mariuzzo mentioned, the access.log revealed that the favicon was status 500.

As a side note, if you would like Laravel to stop logging 404s/Resource Not Found as errors in log files, you can edit your global.php file like the following.

App::error(function(Exception $exception, $code)
{
    // Don't log 404s
    if ($exception instanceof Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
        return;
    }

    Log::error($exception);
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!