Skip to main content

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

Project description

logging-journald

PyPI - License Wheel PyPI PyPI Coverage Status tests

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

import logging
from logging_journald import JournaldLogHandler, check_journal_stream

# Use python default handler
LOG_HANDLERS = None


if (
    # Check if program running as systemd service
    check_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.6.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

logging_journald-0.6.6-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file logging_journald-0.6.6.tar.gz.

File metadata

  • Download URL: logging_journald-0.6.6.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.2 Darwin/22.3.0

File hashes

Hashes for logging_journald-0.6.6.tar.gz
Algorithm Hash digest
SHA256 ba71558cd10d07fe06a9713342026215a7ac792a55658d078d8f4d88964b350b
MD5 4c1bae89d4c86ff26f1f386971026940
BLAKE2b-256 e2018fc0a3d789b14d2679ef640d66070dd5c18eeb764e5884af791d7395cf91

See more details on using hashes here.

File details

Details for the file logging_journald-0.6.6-py3-none-any.whl.

File metadata

File hashes

Hashes for logging_journald-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 afcedadcd82c668794a68aa1243fbe0f6e0ecfec1f24c79b3baa064a5d18af14
MD5 e5709f8b3a53e24bfcc1f7c43cc140a0
BLAKE2b-256 60d3ff2810077efec2cded75df757dec00b6a5d7a6bc5e418f35e0c0535390bb

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