PHP code example of errorstream / errorstream-yii2

1. Go to this page and download the library: Download errorstream/errorstream-yii2 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/ */

    

errorstream / errorstream-yii2 example snippets


    'components' => [
        ...
        'errorstream' => [
            'class'             => 'ErrorStream\ErrorStreamClient\ErrorStreamClient',
            'api_token'         => 'YOUR_API_TOKEN', //Put your api token here
            'project_token'     => 'YOUR_PROJECT_TOKEN', //Put your project token here
            'active'            => true, //You might want to only activate this in production mode
        ]
        ...
    ]

'components' => [
    ...
    'errorHandler' => [
        'errorAction' => 'site/error',
        'class' => 'ErrorStream\ErrorStream\ErrorStreamErrorHandler',
    ],
    ...
]

    'components' => [
        ...
        'log' => [
            ..
            'targets' => [
                ...
                [
                    'class' => 'ErrorStream\ErrorStream\ErrorStreamLogger',
                    'levels' => ['error', 'warning'], //Only send errors and warnings.
                    'logVars' => [], //Necessary so you don't submit every request to our server.
                ],
                ...
            ],
        ]
    ]