Send errors (5xx) to a slack channel
You can install the package using the Composer package manager. You can install it by running this command in your project root:
composer require ethercreative/yii2-slack-error-logger
Add the class to your configuration file.
You will need to create an incoming webhook
// ...
'log' => [
// ...
'targets' => [
[
'class' => 'ethercreative\log\Error',
'levels' => ['error'],
'webhook' => 'https://hooks.slack.com/...',
'name' => 'The name of your project',
'username' => 'The username for the user',
'channel' => '#thechannel',
],
],
],
// ...