autoxloo / yii2-sentry
Yii2 wrap of Sentry PHP SDK
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.5.0
- sentry/sentry: ~1.9.2
- yiisoft/yii2: ~2.0.0
Requires (Dev)
This package is auto-updated.
Last update: 2025-02-19 23:00:10 UTC
README
Yii2 wrap of Sentry PHP SDK
Note: This package is not supported properly
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist autoxloo/yii2-sentry "*"
or
composer require --prefer-dist autoxloo/yii2-sentry "*"
or add
"autoxloo/yii2-sentry": "*"
to the require section of your composer.json
file.
Config
In your application config add:
// ... 'components' => [ // ... 'sentry' => [ 'class' => \autoxloo\yii2\sentry\SentryComponent::class, 'ravenDsn' => 'https://0000000000000000000@sentry.io/000000', // Your sentry dsn 'allowCaptureMessage' => true, ], ],
Usage
Once the extension is installed, simply use it in your code by:
\Yii::$app->sentry->getRavenClient()->captureMessage('some message');
or
\Yii::$app->sentry->captureMessage('some message');
Note: In last example captures message only if
allowCaptureMessage
istrue
.
See sentry docs for more details https://docs.sentry.io/clients/php/