php - Laravel 4 Exception: NotFoundHttpException -
my laravel 4 application's logs show notfoundhttpexception:
exception 'symfony\component\httpkernel\exception\notfoundhttpexception' in /var/www/laravel4/bootstrap/compiled.php:7420 stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): illuminate\routing\router->handleroutingexception(object(symfony\component\routing\exception\resourcenotfoundexception)) #1 /var/www/laravel4/bootstrap/compiled.php(7113): illuminate\routing\router->findroute(object(illuminate\http\request)) #2 /var/www/laravel4/bootstrap/compiled.php(958): illuminate\routing\router->dispatch(object(illuminate\http\request)) #3 /var/www/laravel4/bootstrap/compiled.php(946): illuminate\foundation\application->dispatch(object(illuminate\http\request)) #4 /var/www/laravel4/public/index.php(49): illuminate\foundation\application->run() #5 {main} what have caused this? stack trace doesn't show code.
a notfoundhttpexception 404 in application. unfortunately exception message doesn't tell url of request triggered exception, makes difficult understand these errors when see them in logs.
to give more debugging information, set own 404 handler. here's simple handler log url (so know requested trigger error) , user agent (to figure out or made request) , return view , 404 code:
app::missing(function($e) { $url = request::fullurl(); $useragent = request::header('user-agent'); log::warning("404 url: $url requested user agent: $useragent"); return response::view('errors.not-found', array(), 404); }); put in app/start/global.php.
Comments
Post a Comment