Question: My Laravel 4 application's logs sometimes show a `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 could have caused this? The stack trace doesn't show anything from my code.

Answer: 
A `NotFoundHttpException` is basically just a 404 in your application. Unfortunately the exception message doesn't even tell you the URL of the request that triggered the exception, which makes it difficult to understand these errors when you see them in your logs.

To give you more debugging information, set up your own 404 handler. Here's a simple handler which will log the URL (so you know what was requested to trigger the error) and the user agent (to help you figure out who or what made the request) and return a view and 404 code:

```
App::missing(function($e) {
    $url = Request::fullUrl();
    $userAgent = Request::header('user-agent');
    Log::warning("404 for URL: $url requested by user agent: $userAgent");
    return Response::view('errors.not-found', array(), 404);
});

```

Put it in `app/start/global.php`.
I got this error because i used method="post" in my form instead of method="POST". 

Might be useful to someone.