This package is for yii2 integration with ErrorStream.com.
We prefer you install this with composer. You can find complete up to date information Here.
Installation ¶
First, run the following command on the terminal to download and install the package
composer require errorstream/errorstream-yii2
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',
],
...
]
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.
'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.
],
...
],
]
]
Switch places please
info level to 3
error to 1
Oh, sorry. It won't help.
Bug is here:
`php\Yii:info('info'); // in dashboard is error
\Yii:error('error'); // in dashboard is info
`It's because Yii returns 1 level in case of error. But your service waits 3.
And ErrorStreamLogger::export send report without workaround you do in getSeverity method.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.