In-Touch / laravel-newrelic

Laravel NewRelic ServiceProvider
173 stars 48 forks source link

Adds a new option to log errors in newrelic when laravel debug is set to false. #16

Closed gvsrepins closed 3 years ago

gvsrepins commented 10 years ago

In order to make the errors appear in the Newrelic dashboard when the debug is set to false I need to add the follow snippet to the app/start/global.php file:

App::error(function(Exception $exception, $code)
{
    Log::error($exception);
    if (App::environment('production'))
    {
        $newrelic = new Intouch\Newrelic\Newrelic;
        $newrelic->noticeError($exception);
    }

});

What you think about this be done behind the scenes and bring this as a new option in the package config file?

pleckey commented 9 years ago

Hi @gvsrepins - my apologies for letting this go so long un-noticed! I like the idea - can you submit a PR against the new L5 refactored version?