jc-it / yii2-monolog-slack-handler
A Yii2 implementation of a Slack Monolog handler with more context and formatting.
v2.0.1
2024-12-16 08:54 UTC
Requires
- php: >=8.1
- samdark/yii2-psr-log-target: ^1.1.3
- yiisoft/yii2: ^2.0.47
Requires (Dev)
- captainhook/plugin-composer: ^5.3
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.2
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-strict-rules: ^1.1
- ramsey/conventional-commits: ^1.3
- symfony/console: ^5.4.2
- symplify/easy-coding-standard: ^10.0
This package is auto-updated.
Last update: 2024-12-16 08:54:32 UTC
README
This extension provides a package that implements some traits and behaviors to work with model attribute translations.
$ composer require jc-it/yii2-monolog-slack-handler
or add
"jc-it/yii2-monolog-slack-handler": "^<latest version>"
to the require
section of your composer.json
file.
Configuration
For basic configuration see https://github.com/samdark/yii2-psr-log-target.
$logger = new Logger('slack-logger'); $handler = new \JCIT\components\log\SlackErrorWebhookHandler( webhookUrl: '<slackErrorWebhookHandler>', channel: '<slackChannel>', username: '<displayUsername>', level: \Monolog\Logger::WARNING, ); $logger->pushHandler($handler);
TODO
- Fix PHPStan, re-add to
captainhook.json
-
{ "action": "vendor/bin/phpstan", "options": [], "conditions": [] },
-
- Add tests
Credits
- Joey Claessen
- Sergey Makinen for the abandoned yii2-slack-log package
License
The MIT License (MIT). Please see LICENSE for more information.