xinningsu / yii2-raygun
Raygun Yii2 logger, Raygun integration for Yii2.
v1.0.0
2025-08-21 08:07 UTC
Requires
- php: >=8.0
- mindscape/raygun4php: ^2.0.0
- yiisoft/yii2: ^2.0.0
Requires (Dev)
- phpunit/phpunit: >=5.0
- squizlabs/php_codesniffer: ^3.0
This package is not auto-updated.
Last update: 2025-08-22 07:47:37 UTC
README
Raygun integration for Yii2, Raygun Error Logger.
Installation
composer require xinningsu/yii2-raygun
Usage
Once you have finished the Raygun installation, set up Raygun component and Raygun log target in Yii common config file, e.g., config/web.php
:
[ // ... 'components' => [ // ... 'raygun' => [ 'class' => \Sulao\YiiRaygun\RaygunComponent::class, 'config' => [ 'api_key' => 'your_raygun_api_key', // Update with your Raygun API key // For more configuration options, please refer to // https://github.com/xinningsu/yii2-raygun/blob/master/config/raygun.php ], ], 'log' => [ // ... 'targets' => [ // ... [ 'class' => \Sulao\YiiRaygun\RaygunTarget::class, 'levels' => ['error', 'warning'], 'except' => [ \yii\web\HttpException::class, ], ], ], ], // ... ], // ... ],
Testing
In the controller
file, add the code below
\Yii::error('test error');;
Or trigger an exception
throw new \Exception('test exception');
Then, check if the report is available in the Raygun Crash Reporting.