1

I have an error, like the error below:
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
The GET method is not supported for this route. Supported methods: PUT.

I know that's a error from routes, but I can't see anything in laravel.log.
Here I saw that Laravel doesn't report some things, but my Exceptions/Handler.php file is like this:

protected $dontReport = [
    //
];

How do I report everything in laravel.log? Laravel 6

danronmoon
  • 3,814
  • 5
  • 34
  • 56
Edinho Rodrigues
  • 354
  • 4
  • 24
  • You can use the [log facade](https://laravel.com/docs/6.x/logging) at the catch block of the request, logging the error as `Log::error($message);`. – Daniela C. Montenegro Jul 09 '20 at 19:31
  • But that way I need to make this in all request. What I would like is to see all the errors in logs – Edinho Rodrigues Jul 09 '20 at 19:37
  • You can override the ```$internalDontReport ``` at the exception handler, as in the question you've cited [before](https://stackoverflow.com/questions/60268280/laravel-logging-route-not-found) – Daniela C. Montenegro Jul 09 '20 at 20:24
  • 1
    the framework itself has an internal list that it doesn't "report" which includes `Symfony\Component\HttpKernel\Exception\HttpException` which that exception extends from ... you would have to log this via your `report` method – lagbox Jul 10 '20 at 01:29

1 Answers1

3

All exceptions are handled by the App\Exceptions\Handler class. Use the report method to log exceptions.

 public function report(Throwable $exception)
 {
    Log::error($exception); // add this line here
    parent::report($exception);
 }

See more from docs here

userbloom
  • 153
  • 1
  • 11