我在日志中发现了NotFoundHttpException.看起来像这样:
[2013-11-26 13:49:20] log.ERROR: exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/myproject/vendor/laravel/framework/src/Illuminate/Routing/Router.PHP:1429 Stack trace: #0 /var/www/myproject/vendor/laravel/framework/src/Illuminate/Routing/Router.PHP(1050): Illuminate\Routing\Router->handleRoutingException(Object(Symfony\Component\Routing\Exception\ResourceNotFoundException)) #1 /var/www/myproject/vendor/laravel/framework/src/Illuminate/Routing/Router.PHP(1014): Illuminate\Routing\Router->findRoute(Object(Illuminate\Http\Request)) #2 /var/www/myproject/vendor/laravel/framework/src/Illuminate/Foundation/Application.PHP(530): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #3 /var/www/myproject/vendor/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():
原文链接:https://www.f2er.com/laravel/140009.htmlApp::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 [] []