HDKT
HDKT

Reputation: 71

Logs not working inside AuthController

I am trying to log Auth activity using Laravel 5.2 built-in Logs API.

The code would be like

\Log::info("Message here");

It works inside HomeController. However, it does not work inside AuthController.

Sample code inside logout method:

public function getLogout()
{
    \Log::info('User has logged out.', ['email' => \Auth::user()->email]);
    \Auth::logout();

    return redirect('/');
}

Upvotes: 0

Views: 59

Answers (1)

lagbox
lagbox

Reputation: 50491

If you are using Route::auth() to register your Auth related routes, it does not use that method, getLogout. It uses logout.

Check your routes with php artisan route:list to see what controller methods those Auth routes are using.

Upvotes: 1

Related Questions