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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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