mercredi 2 septembre 2015

Send a slack notification every time Log::error is triggered

Using Laravel 5, I want to be notified (on slack but it does not matter) every time Log::error (or similar) is triggered, by a direct call to this method or by the default ExceptionHandler calling report method. I think I have to extends default Laravel's Log system but I'm not sure. What's the (best) "laravel way" to do this ? (without changing every Log::error calls in my whole code).

First, I thought I only have to change Log Facade to one other but it will not handle the ExceptionHandler (i.e. on 500 errors due to uncaught Exception). One other solution could be add some code directly in the ExceptionHandler, but it will not be triggered if I report an error by Log::error() or some other way (app('logger')->error(), logger()->error(), etc.).



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1NXE2Y7
via IFTTT

Aucun commentaire:

Enregistrer un commentaire