hiromi2424 / cakephp-slack-log-engine
Slack log engine for CakePHP
Installs: 841
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 3
Open Issues: 0
Type:cakephp-plugin
Requires
- cakephp/cakephp: ~3.0
- maknz/slack: ~1.7
Requires (Dev)
This package is not auto-updated.
Last update: 2024-11-09 20:39:42 UTC
README
What is this?
This is CakePHP plugin to provide a log engine that post to slack using incoming webhooks.
Please see detail how to configure webhooks on slack.
The engine uses Slack for PHP and is just thin wrapper for the library.
Installation
composer require hiromi2424/cakephp-slack-log-engine
Requirements
- CakePHP 3.x
- PHP 5.5+
Usage
Configure log
In your app.php, you can configure like:
'Log' => [
'error' => [
'className' => 'SlackLogEngine\Log\Engine\SlackLogEngine',
// Your slack hook URL here
'hookUrl' => 'https://hooks.slack.com/services/xxxxx/xxxxx/xxxxxxxxxx',
// Send logs of following levels to slack
'levels' => ['error', 'critical', 'alert', 'emergency'],
],
],
Log options
Either client
or hookUrl
is required.
hookUrl
[string] Slack hook url.client
[\Maknz\Slack\Client] Slack client instance for custom.clientClass
[string(optional)] slack client class. This option is used only withhookUrl
option.
Other available settings can be seen at Slack for PHP Official Docs