Skip to content

Commit bf78b29

Browse files
2 parents bf79728 + 56abfd5 commit bf78b29

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ By default Rollbar Laravel supports auto-discovery. If you do not want to auto-d
3535
}
3636
},
3737
```
38+
Don't forget to run `$ php artisan package:discover` to recreate `Package manifest file`.
3839

3940
### Enabling / disabling Rollbar on specific environments
4041

src/RollbarServiceProvider.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ public function register()
6060
$this->app->singleton('Rollbar\RollbarLogger', function ($app) {
6161

6262
$defaults = [
63-
'environment' => $app->environment(),
64-
'root' => base_path(),
63+
'environment' => $app->environment(),
64+
'root' => base_path(),
65+
'handle_exception' => true,
66+
'handle_error' => true,
67+
'handle_fatal' => true,
6568
];
6669
$config = array_merge($defaults, $app['config']->get('services.rollbar', []));
6770
$config['access_token'] = getenv('ROLLBAR_TOKEN') ?: $app['config']->get('services.rollbar.access_token');
@@ -70,7 +73,11 @@ public function register()
7073
throw new InvalidArgumentException('Rollbar access token not configured');
7174
}
7275

73-
\Rollbar\Rollbar::init($config);
76+
$handleException = (bool) array_pull($config, 'handle_exception');
77+
$handleError = (bool) array_pull($config, 'handle_error');
78+
$handleFatal = (bool) array_pull($config, 'handle_fatal');
79+
80+
Rollbar::init($config, $handleException, $handleError, $handleFatal);
7481

7582
return Rollbar::logger();
7683
});

0 commit comments

Comments
 (0)