PHP code example of sergeymakinen / yii2-slack-log

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

    

sergeymakinen / yii2-slack-log example snippets


'components' => [
    'log' => [
        'targets' => [
            [
                'class' => 'sergeymakinen\yii\slacklog\Target',
                'webhookUrl' => 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX',
            ],
        ],
    ],
],

'components' => [
    'log' => [
        'targets' => [
            [
                'class' => 'sergeymakinen\yii\slacklog\Target',
                'levels' => ['error'],
                'except' => [
                    'yii\web\HttpException:*',
                ],
                'enabled' => YII_ENV_PROD,
                'webhookUrl' => 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX',
                'username' => 'Fire Alarm Bot',
                'iconEmoji' => ':poop:',
            ],
        ],
    ],
],