Tracking exceptions with Bugsnag

Until today, I kept an eye on any errors on this website by sending them to myself by email. Although this works, I thought it was time to look for a better way of handling exceptions. Enter Bugsnag, a service that lets you track errors and exceptions and view them in a dashboard. These are my first experiences working with Bugsnag.

Easy installation

Signing up for Bugsnag was fast and installing it was almost as easy. Thanks to the bugsnag-laravel package it's as easy as replacing the default App\Exceptions\Handler class.

The documentation is excellent, there are just 2 things that I did to expand on the default installation:

  1. In order to track the version number of my project with each exception I have the following report function:

    public function report(Exception $e)
    {
     Bugsnag::setAppVersion(config('app.version'));
    
     parent::report($e);
    }
    
  2. Because the environment configuration doesn't allow for array values I've set up my /config/bugsnag.php configuration for with a static array:

    'notify_release_stages' => array('production'),
    

And now we wait

So far, so good. Everything is set up and now it is time to wait and see how the dashboard and notifications work. Bugsnag supplies multiple integrations with (among others) Slack, Hipchat and Github issues, but that is something for later.

Free for open source

It is possible to sign up for a free 14-day trial with access to all features. Open source projects can even request free access as detailed in this blog post. I did and am now enjoying the benefits, which is also why I wanted to share my great experience with you :-)

Related articles

Comments (0)

Got a question? Liked the article or got a suggestion? Leave a comment to let us know.