Réjôme
Réjôme

Reputation: 1484

Where do you put Log::listen?

I have a simple Laravel 5 application.

I don't know where to put the snippet

Log::listen(function($level, $message, $context)
{
    //
    doStuff();
});

I tried to put it in the routes.php but:

Thanks for any advice.

Upvotes: 1

Views: 224

Answers (1)

Margus Pala
Margus Pala

Reputation: 8663

One good place is to write new Middleware or do your own ServiceProvider. I find myself Middleware easier.

Read more from http://laravel.com/docs/5.0/middleware

Upvotes: 1

Related Questions