accessd / yii2-rollbar
Rollbar Yii2 Error Handler
Requires
- php: >=5.4
- rollbar/rollbar: ~0.12.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-11-01 19:37:41 UTC
README
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist accessd/yii2-rollbar "*"
or add
"accessd/yii2-rollbar": "*"
to the require section of your composer.json
file.
Usage
All of these blocks may be included in one config file (frontend/config/main-local.php) for quite simple applications.
Your most global main.php file:
'bootstrap' => ['rollbar'], 'components' => [ 'rollbar' => [ 'class' => 'accessd\yii2_rollbar\RollbarComponent', 'accessToken' => 'POST_SERVER_ITEM_ACCESS_TOKEN', ], ],
main-local.php (common/config/main-local.php for advanced app template):
'components' => [ 'rollbar' => [ 'environment' => 'production', // you environment name ], ],
web error handler (frontend/config/main-local.php for advanced app template):
'components' => [ 'errorHandler' => [ // handling uncaught PHP exceptions, execution and fatal errors 'class' => 'accessd\yii2_rollbar\WebErrorHandler', ], ],
console error handler (console/config/main-local.php for advanced app template):
'components' => [ 'errorHandler' => [ // handling uncaught PHP exceptions, execution and fatal errors 'class' => 'accessd\yii2_rollbar\ConsoleErrorHandler', ], ],
Does it work?
You can just write incorrect settings for database connection and refresh a site page or execute any console command. Rollbar issues will appear at the Dashboard in a few seconds.