sergeymakinen/yii2-slack-log Pretty Slack log target for Yii 2

logloggingyii2-slack-logslack

Slack log target for Yii 2

Pretty Slack log target for Yii 2.

Screenshot

Code Quality Build Status Code Coverage SensioLabsInsight

Packagist Version Total Downloads Software License

Installation

The preferred way to install this extension is through composer.

Either run

composer require "sergeymakinen/yii2-slack-log:^2.0"

or add

"sergeymakinen/yii2-slack-log": "^2.0"

to the require section of your composer.json file.

Usage

First set up an incoming webhook integration in your Slack team and obtain a token. It should look like https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX.

Then set the following Yii 2 configuration parameters:

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

Sample config:

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

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v2.0.1 is the latest of 9 releases



MIT license
Stats
20 github stars & 3 github forks
32 downloads in the last day
1377 downloads in the last 30 days
92584 total downloads