Skip to main content

Post formatted log messages to slack, mentioning users when error ocurrs

Project description

licenseware-logblocks

Installation

pip install licenseware-logblocks

How it works?

Having a log stream, you can read line by line and send it to logblocks:

log_stream() { while true; do echo $RANDOM; sleep 1; done; }
while IFS= read -r line; do echo $line | logblocks $line; done < <(log_stream)

SLACK_TAGGED_USERS_IDS will be tagged on all ERRORS

Requirements

Environment variables:

  • SLACK_TAGGED_USERS_IDS (ex: export SLACK_TAGGED_USERS_IDS="<@U02CS9QL0JK>, <@U02U2KQ7N3Y>, <@U030JAJF5RV>, <@U02SDCAHJH3>, <@UHW04RBGT>");
  • SLACK_CHANNEL_WEBHOOK_URL (ex: export SLACK_CHANNEL_WEBHOOK_URL=https://hooks.slack.com/services/etc/etc/etc)

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

licenseware_logblocks-0.3.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

licenseware_logblocks-0.3.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file licenseware_logblocks-0.3.0.tar.gz.

File metadata

  • Download URL: licenseware_logblocks-0.3.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for licenseware_logblocks-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7bb3fac8b31a4019448b201e942e849ca67bdc6008d469850f3773b92c7d5af4
MD5 30df2d56a22a2b624004f4887876afd7
BLAKE2b-256 5969493d1575b9fe38a03b2a99be7a1dc4ac161068f05a47c76e16d1669064e2

See more details on using hashes here.

File details

Details for the file licenseware_logblocks-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for licenseware_logblocks-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a059fd3df663a099c287a99320a71ad38c34ab93b0cd3c7ba44ec13ed547cb7
MD5 e3483509e55f136063f43217efb4fdd2
BLAKE2b-256 de4a436be842249285781395eb525462c6efbe846f5773acc65e7be310b06315

See more details on using hashes here.

Supported by

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