Skip to main content

Pure python logging handler for writing logs to the journald using native protocol

Project description

Pure python logging handler for writing logs to the journald using native protocol.

import logging
from logging_journald import JournaldLogHandler

# Use python default handler
LOG_HANDLERS = None


if (
    # Check if program running as systemd service
    JournaldLogHandler.JOURNAL_STREAM or
    # Check if journald socket is available
    JournaldLogHandler.SOCKET_PATH.exists()
):
    LOG_HANDLERS = [JournaldLogHandler()]

logging.basicConfig(level=logging.INFO, handlers=LOG_HANDLERS)
logging.info("Hello logging world.")

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

logging-journald-0.6.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file logging-journald-0.6.0.tar.gz.

File metadata

  • Download URL: logging-journald-0.6.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for logging-journald-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6c5e1a20f655636cbbd68229e3acb1f39ffe6089b44ee82753ca84581a619d3a
MD5 b39ef63085f5946bc65e3c3b8c5b930b
BLAKE2b-256 76126ab660aea1443a814e0de797233b217edfe834da79bef194f71df215ac96

See more details on using hashes here.

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