xinningsu / yii2-raygun
Raygun Yii2 logger, Raygun integration for Yii2.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/xinningsu/yii2-raygun
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-10-31 08:43:17 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.