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,
                   extras=None
                   )
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.

extras may optionally be set to a dictionary with the contents of Message Extras that you wish to pass along with all log messages.

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.3.tar.gz (3.2 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.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gotify_handler-1.0.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for gotify_handler-1.0.3.tar.gz
Algorithm Hash digest
SHA256 0034bdb2eee27c3b6bb9b569a750acb756313a2bfa8e387741b076bc4b54b0b9
MD5 6514921be497d6552f612780eb19ab4d
BLAKE2b-256 76df9bd92654229297dd09c5785d59b3bd85dfbdcce60ccead9917b72b658f0b

See more details on using hashes here.

File details

Details for the file gotify_handler-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: gotify_handler-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for gotify_handler-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc76a945d11225a7f8b3b768e976a659caec99a4a5fb2a94d7ada0e398a2113
MD5 7d800a9ce0ddf9c2fa458523c13b14ef
BLAKE2b-256 7a45afa56ca165d21858b077775aa113c2ac446a8b99d2464869f34d462f405b

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