Skip to main content

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

Project description

logging-journald

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.5.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

logging_journald-0.6.5-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: logging_journald-0.6.5.tar.gz
  • Upload date:
  • Size: 3.7 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.5.tar.gz
Algorithm Hash digest
SHA256 80d7ea349a688a5dfaf22d79593243260cfa46a68eb3c3eba794b85018ea071d
MD5 cf823139a11345dc3b65bf35ec311564
BLAKE2b-256 11e4923fa7d5e108a449d8f63e93dab74b6634796ae90018329b228431de099e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for logging_journald-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eb667de882636f015cb25db841fe59af2dfc4410be0b7717c23f67321deaa2ff
MD5 135c519f9ae2e6e8b46d3ff27167264a
BLAKE2b-256 59161229ced15f317395126917b44f942af812955816affb96acd06775168364

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