Skip to main content

An extremely simple logging handler for relaying log events to gotify

Project description

gotify-handler

This repo contains an extremely simple logging handler that relays log events to gotify.

Installation

pip install gotify_handler

Usage

import logging
from gotify_handler import GotifyHandler

logger = logging.getLogger()
logging.basicConfig()

gh = GotifyHandler(server_url="https://gotify.example.com",
                   app_token="$APP_TOKEN",
                   alert_on_log_level=logging.WARNING
                   )
logger.addHandler(gh)

logger.info("Example info (doesn't cause a notification)")
logger.warning("Example warning (causes a notification)")

alert_on_log_level defaults to logging.WARNING, but can be set to any value to make log events trigger notifications on gotify. If the log level is below this value, records are sent to gotify with a priority value of 0. Else, records are sent with a priority value of 5.

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

gotify_handler-1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gotify_handler-1.0-py2.py3-none-any.whl (3.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file gotify_handler-1.0.tar.gz.

File metadata

  • Download URL: gotify_handler-1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for gotify_handler-1.0.tar.gz
Algorithm Hash digest
SHA256 a9f7f54a33b04bc2e3614c0bf29241dfa11c3c6bbe32c731cd2fe059b0a41795
MD5 73e32162ed71d0d7a032394d8e005746
BLAKE2b-256 9da1ecf195cba9b6baf3c0457d6e1c210735099b5eeff10c04252c2fde8cc283

See more details on using hashes here.

File details

Details for the file gotify_handler-1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gotify_handler-1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2f75112489422eff4a3ff603017f29edd4d9760cc07f0345f4d3c9cf4f2da28e
MD5 db7aa3bf489e561ac576c69a6cfd3f6c
BLAKE2b-256 fa2ae77098affd3043ca5bb363ebde4abc7f6bac688e861d45a413759335af1d

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