Welcome to ErrorStream For Yii 2.0
Here we're going to show you how to install the extension for yii 2.0 and how to integrate it into your project. Your code will only report errors when enabled is set to true, so you can disable this during development if you do not want any additional reporting. You can find the package on packagist here and the github repo here
Installation
First, run the following command on the terminal to download and install the package.
composer require errorstream/errorstream-yii

Next, register the client class in your web.php configuration file. You can find your API token and Project token on the project settings page inside of errorstream.com


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

Next, you want to edit the errorHandler setting in web.php configuration file. You'll want to place the ErrorStreamErrorHandler as a 'class' for your error handler, like this.


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

Finally, you want to edit the errorHandler setting in web.php configuration file. You'll want to place the ErrorStreamErrorHandler as a 'class' for your error handler, like this.


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

// ...
]

Thats it! Let us know if you have any trouble integrating. We're more than happy to help!