Skip to main content

Python logging handler which posts to slack

Project description

Slack logger

This package provides a logging.Handler that will send message to a slack channel. Supports updated slack.WebClient API released in 2019.


See https::// to for information on setting up app and get an authorization token. Only a "bot" token is required to use SlackHandler, however, the unittest is more comlete with a "user" token.


How often messages can be sent is limited by slack. See By default, this handler only sends accumulated messages every 60 seconds. That can be adjusted by the optional update argument to SlackHandler.


token = 'your token here'
channel = 'your channel name'
handler = SlackHandler(token, channel)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
example_logger = logging.getLogger("Test Logger")
example_logger.propagate = False
example_logger.setLevel(logging.INFO)"Then shalt thou use Python three, no more, no less.")
# at end of program

Funding acknowledgment

This work supported by National Institutes of Health (NIH) / National Institute of General Medical Sciences (NIGMS), grant 1P41GM111135.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for slack-webclient-logger, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size slack_webclient_logger-1.0.1-py3-none-any.whl (2.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size slack-webclient-logger-1.0.1.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page