Python logging handler that can be configured to send messages to a Slack channel.
SlackLogger
builds on the base built-in logging.Handler
to allow logging messages to logged via HTTPS to a Slack channel.
In addition to this, the handler also builds on the logging.Formatter
class to help build fancier Slack messages
using their layout blocks.
The following tags are supported:
- Header: plain text
- Section: supports markdown
- Divider: no text support
The package can be installed from the PyPi repository with pip install grassed
or cloned from the git repo.
Read the docs for usage and examples.
Check out Slack's documentation for Incoming Webhooks to learn how to set up a Slack app that can handle the incoming messages.
SlackHandler is designed to log important messages to a place where people can view them immediately and respond. Note that Slack imposes message rate limits which SlackHandler respects.
Released under GPLv3 by Sam Vanderslink. Free to modify and reuse.