rigor789 / airbrake-laravel

Laravel package for the Airbrake API, which supports Errbit
MIT License
16 stars 9 forks source link

Log facade integration #7

Closed marvinosswald closed 8 years ago

marvinosswald commented 8 years ago

It seems to me as Log::error for example doesn't get reported at all, would like to use it to enhance a few errors with more informations. Isn't it integrated yet or am I just missing something ?

rigor789 commented 8 years ago

Hey,

Log::error() is a logging utility that writes to the log file. It is not an exception, and it does not reach the ExceptionHandler. If you want to collect these as well consider throwing exceptions when they occur. Or create an event listener that listens for the illuminate.log event, and call

$handler = app('Illuminate\Contracts\Debug\ExceptionHandler');
$handler->report(new SomeCustomException('message from log'));

to manually send the error.