Skip to main content

Python Slack log handler using webhook

Project description

# Python Slack log handler

Simple Python log handler for Slack using Slack webhooks.

# Installation

```sh
$ pip install slack_log_handler
```

## Usage

The only required argument for `SlackLogHandler` is the webhook URL.
You can pass the `channel`, `username`, or a dictionary of `emojis` for each
log level as named arguments.

Sample usage:

```python
import os
import logging
from slack_log_handler import SlackLogHandler

WEBHOOK_URL = os.getenv('SLACK_URL')

slack_handler = SlackLogHandler(WEBHOOK_URL)
slack_handler.setLevel(logging.WARNING)

logger = logging.getLogger(__name__)
logger.addHandler(slack_handler)

logger.error('Oh my god, an error occurred!')
```

Project details


Download files

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

Source Distribution

slack_log_handler-0.2.2.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file slack_log_handler-0.2.2.tar.gz.

File metadata

File hashes

Hashes for slack_log_handler-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5067c668177b3db133f77c6e07b9ca93baf7deac3b974c2b2319ec88c6b0f74c
MD5 d69231bec29bd4c4f823aeeed03fb69b
BLAKE2b-256 7ae9e713367dc27b6a5c3455409ade7c90e2f65a636186423c0da6eb6ddf9183

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page