PHP code example of xinningsu / yii2-raygun

1. Go to this page and download the library: Download xinningsu/yii2-raygun library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xinningsu / yii2-raygun example snippets


[
    // ...
    '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,
                    ],
                ],
            ],
        ],
        // ...
    ],
    // ...
],

\Yii::error('test error');;

throw new \Exception('test exception');