PHP code example of mamatveev / yii2-useful-log-targets

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

    

mamatveev / yii2-useful-log-targets example snippets


        'log' => [
            'targets' => [
                //sentry log target
                [
                    'class' => 'mamatveev\yii2LogTargets\SentryLogTarget',
                    'levels' => ['error', 'warning'],
                    'dsn' => 'your_sentry_dsn',
                ],
                //elasticSearch log target. connection should be configured 
                [
                    'class' => 'mamatveev\yii2LogTargets\ElasticLogTarget',
                    'levels' => ['info', 'error', 'warning'],
                    'index' => 'oplata-fssp',
                    'type' => 'oplata-fssp-applog',
                    'logVars' => ['_GET', '_POST'],
                    'except' => [
                        'yii\web\HttpException:404',
                        'yii\db\Connection::open',
                    ],
                ]
            ],
        ],