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.2.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.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gotify_handler-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3cc2584a9c5cb588672111eb5c1fc75f6524a9bca181dc5fa4975a795bb0ccf7
MD5 f8983b1f7f764ad9e7d0fd4ff907279a
BLAKE2b-256 06f30d30b0773c071702c2820ea496d845e9f99bf8479680b4e3cbe1702cd05e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gotify_handler-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f8d11b92b45540e9ddf07c485f49fa4815f7ce00754b4e267e0bed238801d85
MD5 b8da5d658f598b0ff804b918b5f4c1ff
BLAKE2b-256 f6ef25e69a29f681f4f76426c07254c99d558c31039632dfe2eb7aa86875c255

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