PHP code example of error-tracker / yii2-log-target

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

    

error-tracker / yii2-log-target example snippets


'log' => [
    'targets' => [
        [
            'class' => 'yii\log\FileTarget',
            'levels' => ['error', 'warning'],
        ],
        [
            'class' => 'ErrorTracker\Yii2\ErrorTrackerTarget',
            'levels' => ['error', 'warning'],
            'app_key' => 'YOUR_APP_KEY'
        ],
    ],
],

try {
    $this->willBreake();
} catch (\Exception $e) {
    Yii::error($e->getMessage(), $e->getName());
}

[
    'class' => 'ErrorTracker\Yii2\ErrorTrackerTarget',
    'levels' => ['error', 'warning'],
    'app_key' => 'YOUR_APP_KEY',
    'enabled' => YII_ENV_PROD,
],