This package contains handlers/processors for sending logs of monolog to a slack channel.
This is a package that can help you send logs through monolog to slack using webhooks. Monolog already has a Slack handler but I am not in favor for these reasons:
It has some bugs
- Although Monolog has the
WhatFailureGroupHandlerI would consider it simpler not to wrap my handler around another handler and have a simpler and faster logic see
- SlackWebhookHandler does not have timeouts and it executes retries if Slack service is down see
- Current package gives you the ability to add a custom formatter to the handler in order to format Attachments. Although you can pass a formatter to Slack Handlers of monolog the formatter is applied only to simple messages of slack and they are not executed for Attachments.
- I like the formatting that I created better than the one that monolog has.
You can install this package through composer
$ composer require webthink/monolog-slack
Please see CHANGELOG for more information what has changed recently.
Assuming you have PHPUnit installed system wide using one of the methods stated here, you can run the tests for this package by doing the following: