php – laravel-4:如何找到NotFoundHttpException的路由?

php – laravel-4:如何找到NotFoundHttpException的路由?,第1张

概述我在日志中发现了NotFoundHttpException.看起来像这样: [2013-11-26 13:49:20] log.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/myproject/vendor/laravel/framework/src/Illum 我在日志中发现了NotFoundhttpException.看起来像这样:
[2013-11-26 13:49:20] log.ERROR: exception 'Symfony\Component\httpKernel\Exception\NotFoundhttpException' in /var/www/myproject/@R_403_6658@or/laravel/framework/src/Illuminate/Routing/Router.PHP:1429Stack trace:#0 /var/www/myproject/@R_403_6658@or/laravel/framework/src/Illuminate/Routing/Router.PHP(1050): Illuminate\Routing\Router->handleRoutingException(Object(Symfony\Component\Routing\Exception\ResourceNotFoundException))#1 /var/www/myproject/@R_403_6658@or/laravel/framework/src/Illuminate/Routing/Router.PHP(1014): Illuminate\Routing\Router->findRoute(Object(Illuminate\http\Request))#2 /var/www/myproject/@R_403_6658@or/laravel/framework/src/Illuminate/Foundation/Application.PHP(530): Illuminate\Routing\Router->dispatch(Object(Illuminate\http\Request))#3 /var/www/myproject/@R_403_6658@or/laravel/framework/src/Illuminate/Foundation/Application.PHP(506): Illuminate\Foundation\Application->dispatch(Object(Illuminate\http\Request))#4 /var/www/myproject/public/index.PHP(49): Illuminate\Foundation\Application->run()#5 {main} [] []

这告诉你什么也不是浪费磁盘空间.

如何找到导致NotFoundhttpException的URI?

在app / start / global.PHP中扩展App :: error():
App::error(function(Exception $exception,$code){    if ($exception instanceof \Symfony\Component\httpKernel\Exception\NotFoundhttpException)    {        Log::error('NotFoundhttpException Route: ' . Request::url() );    }    Log::error($exception);});

现在你得到一个附加的日志条目与URL:

[2013-11-26 14:20:07] log.ERROR: NotFoundhttpException Route: http://myproject.net/asdfgsdfghsdfg [] []
总结

以上是内存溢出为你收集整理的php – laravel-4:如何找到NotFoundHttpException的路由?全部内容,希望文章能够帮你解决php – laravel-4:如何找到NotFoundHttpException的路由?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1267468.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存