1

When the failed login in my site, logged error in laravel.log file. I use laravel passport for the api authentication.

Error:

[2018-08-06 13:27:35] local.ERROR: League\OAuth2\Server\Exception\OAuthServerException: The user credentials were incorrect. in /home/roberto/new_site/vendor/league/oauth2-server/src/Exception/OAuthServerException.php:128

How to disable the oauth log?

4
  • The user credentials were incorrect Commented Aug 6, 2018 at 11:32
  • Do you want to hide the error from being logged, or to fix the problem which causes the error? Commented Aug 6, 2018 at 11:44
  • just add a new user Commented Aug 6, 2018 at 11:56
  • I want to hide the error so that it does not get into the laravel.log file when the wrong password etc. The login is working if I give you valid email/password. Commented Aug 6, 2018 at 12:25

1 Answer 1

5

You can add that exception to the $dontReport array in app\Exceptions\Handler.php.

protected $dontReport = [
    \Illuminate\Validation\ValidationException::class,
    // ....
    \League\OAuth2\Server\Exception\OAuthServerException::class,
];

This should disable the reporting (logging) of that exception. For more info, see https://laravel.com/docs/5.6/errors#the-exception-handler

Sign up to request clarification or add additional context in comments.

1 Comment

hi, it is not working "laravel/passport": "7.5.1"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.