'Whoops Slack' is a handler for Whoops. It sends message to Slack when error is occured.
Use Composer to install Whoops into your project:
composer require Airteltour/whoops-slack
$client = new Maknz\Slack\Client('https://hooks.slack.com/services/T00000000/B00000000/xxxxxxxxxxxxxxxxxxxxxxxx', [
'username' => 'your-user-name',
'channel' => '#your-channel'
]);
$whoops = new Whoops\Run;
$whoops->pushHandler(new Airteltour\Whoops\SlackHandler($client));
$whoops->register();
new Airteltour\Whoops\SlackHandler($client, [
'template' => __DIR__ . '/other/yours.template.php',
'max_array_depth' => 3,
'max_array_count' => 5,
]);
max_array_depth
Array value's maximum depth. You will show the message like below.
max_array_depth = 2
Array[
[depth1] => Array[
[depth2] => Array[
...many depth...
],
],
],
max_array_count
Array value's maximum count. You will show the message like below.
max_array_count = 3
Array[
[0] => Array[],
[1] => Array[],
[2] => Array[],
...many count...
],
$handler = new Airteltour\Whoops\SlackHandler($client);
$handler->filter(function (\Exception $exception, \Whoops\Exception\Inspector $inspector) {
if ($exception instanceof \Some\Notice\Exception) {
return false;
}
return true;
});
- File name and line
- Error message
- $_SERVER
- $_POST
- $_GET
- Backtrace