Skip to main content

# Slack Logging

The slack logging package provides an interface to send log messages to a suitably configured slack channel

slack_logging currently supports python2 and python3.

## Interface The slack logging does not override the default python logging. It provides a simple interface to create a logger capable of writing messages to slack `python >>> import slack_logging >>> logger = slack_logging.configure_slack_logger(logger_name='my-app-logger') `

## Managing slack integrations After creating and integrating a slack app with a channel, a webhook is provided. This webhook should be added to slack_logging before the logging handler will attempt to write to the channel: `python >>> import slack_logging >>> channel = slack_logging.Channel('channel-1', 'https://slack.com/webhook/channel-1/') >>> slack_logging.WebHooks.configure_channel(channel) `

## Channels When creating a slack_logging.channel instance, you have the option of providing a log level. If the log level is provided, the logging to the channel is restricted to that level. Any logging calls with a level different (higher or lower) than that level will not be logged. If not level is provided, the logger will have the level of the handler. configuring channels after handlers have been created will cause the handlers to send messages to the new channels.

## Handlers The slack-logging python package simply provides a SlackLoggerHandler that with the SlackLoggerFormatter creates a json message sent using the requests library. The handler only supports simple text messages. Stubs are in place to support attachments.

## Error Levels Only the default python error levels are fully supported. While other log levels can be set, by default they will not have full message format support. To support a new log level, create the level as normal and assign it a name via logging

### Adding emojis/colours `python >>> import slack_logging >>> slack_logging.set_level_emoji(log_level='MY_LOG_LEVEL', emoji=':joy:') `

Metadata

Release files for slack-logging 1.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slack-logging 1.1.8
File Size Uploaded Provenance Actions
slack_logging-1.1.8.tar.gz 5.4 kB Without provenance Details for slack_logging-1.1.8.tar.gz

Release files / slack_logging-1.1.8.tar.gz

Download URL slack_logging-1.1.8.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
08216b6c890f544b3927c6ae65a029592d6a26dade96ee6b6ae02880436de466
BLAKE2b-256 checksum
How to use checksums
d59770dd8367d5d636666dd45d3697eb2037a4cfe55ede42c0843430a571ecaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/2.7.14

Security for slack-logging 1.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page