Victor
Victor

Reputation: 5363

Disable bugsnag on certain instances

I'm trying to use bugsnag for Laravel 5. I got some instances of my application: local, a couple of production, testing etc.

In this https://github.com/bugsnag/bugsnag-laravel documentation it says that I need to replace the Exception handler to Bugsnag handler. But how can I disable Bugsnag for some of my instances?

I made an .env file where I put the apikey, so it'd cool not to use Bugsnag if I don't have that key set (for example).

Right now each instance I create needs apikey or it won't work, and this is a little bin inconvenient. Also, if I put Bugsnag notifications inside my code, what would be the best way to use them only if the env/config var is set, I guess manually checking is not a good idea.

Upvotes: 4

Views: 5333

Answers (2)

Albert Tjornejoj
Albert Tjornejoj

Reputation: 460

In the file config/bugsnag.php you can update this line 'notify_release_stages' => ['production'],

Upvotes: 3

karianneberg
karianneberg

Reputation: 328

Bugsnag has a config option for this now:

Bugsnag::setNotifyReleaseStages(['development', 'production']);

This restricts the reporting to the configured environments.

Upvotes: 7

Related Questions