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.2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file licenseware-logblocks-0.2.0.tar.gz.

File metadata

  • Download URL: licenseware-logblocks-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for licenseware-logblocks-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ee6cc54603b2c29837395906f24dc9c8fac35313afe0207f8928b71c39c667e3
MD5 6c195478585c82d12c45781b14ac08ef
BLAKE2b-256 5692b6e81b17fadb4e37e0856d5e46bae29519f5049a0980960b4e7d4880f18f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for licenseware_logblocks-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38c2e99255f6c5285f3fd255ed68a1be19831b117201da01fdccbb4b24509c0c
MD5 e464c29eb516fc645875a8b450b2c6a3
BLAKE2b-256 4f66dd14982bc3d9ab64d5d4e04b846d5c69de65688b85b57f4b29747372cc3e

See more details on using hashes here.

Provenance

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