alex-salt / yii2-sentry
Yii2 sentry error handler
Installs: 3 987
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- sentry/sentry: ~1.0
- yiisoft/yii2: ~2.0
This package is not auto-updated.
Last update: 2024-11-09 20:28:16 UTC
README
Config
'components' => [ 'sentry' => [ 'class' => 'alexsalt\sentry\Client', 'dsn' => '<your_dsn_url>', 'options' => [ 'exclude' => [ 'yii\\web\\NotFoundHttpException', 'yii\\web\\ForbiddenHttpException', 'yii\\web\\UnauthorizedHttpException', 'yii\\base\\InvalidRouteException', ], ], ], 'errorHandler' => [ 'class' => 'alexsalt\sentry\ConsoleErrorHandler', ], 'log' => [ 'targets' => [ [ 'class' => 'alexsalt\\sentry\\LogTarget', 'levels' => [ 'warning', 'error' ], ], ], ], ]
Use alexsalt\sentry\WebErrorHandler
for web apps
Logging
// basic Yii::error('message'); // extra data Yii::error([ 'msg' => 'message name', 'data' => [ 'foo' => 'bar', ], ]); // capture exception try { throw new \Exception('test'); } catch (\Exception $e) { Yii::$app->errorHandler->logException($e); }