websupport / yii-sentry
Layer for Yii framework for communication with Sentry logging API
Installs: 18 582
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 9
Forks: 5
Open Issues: 1
Type:yii-extension
pkg:composer/websupport/yii-sentry
Requires
- php: >=7.1
- guzzlehttp/psr7: ^1.6 || ^2.0
- php-http/curl-client: ^2.0
- sentry/sdk: ^3.1
- yiisoft/yii: ^1.1.18
Requires (Dev)
- roave/security-advisories: dev-latest
Conflicts
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-10-25 10:35:41 UTC
README
Logging Extension for Yii framework for communication with Sentry logging API
Installation
Yii Sentry is composer library so you can install the latest version with:
composer require websupport/yii-sentry
Configuration
Add following to your application's config:
PHP error reporting
'components' => [ 'log' => [ 'class' => \CLogRouter::class, 'routes' => [ // your other log routers array( 'class' => \Websupport\YiiSentry\LogRoute::class, 'levels' => E_ALL, 'enabled' => !YII_DEBUG, ], ], ], 'sentry' => [ 'class' => \Websupport\YiiSentry\Client::class, 'dsn' => '', // Your's DSN from Sentry ], )
JS error reporting
'preload' => ['sentry'], 'components' => [ 'sentry' => [ 'class' => \Websupport\YiiSentry\Client::class, 'jsDsn' => '', // Your's DSN from Sentry ], ]
Sending user context to JS
\Websupport\YiiSentry\Client component has public method: setJsUserContext($context) which will send $context to Raven JS instance.
You can call this method multiple times from any part of the system. Recommended way however is to use it in CWebUser class right after init.