Skip to main content

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.")

MESSAGE_ID field

As defined in catalog documentation:

A 128-bit message identifier ID for recognizing certain message types, if this is desirable. This should contain a 128-bit ID formatted as a lower-case hexadecimal string, without any separating dashes or suchlike. This is recommended to be a UUID-compatible ID, but this is not enforced, and formatted differently. Developers can generate a new ID for this purpose with systemd-id128 new.

So you're free to choose how you want to act. By default, MESSAGE_ID is generated as a hash of the message and some static fields. But you can disable this by passing use_message_id=False to the class constructor.

from logging_journald import JournaldLogHandler

...

handler = JournaldLogHandler(use_message_id=False)

...

Metadata

Release files for logging-journald 0.6.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logging-journald 0.6.12
File Size Uploaded
logging_journald-0.6.12.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for logging-journald 0.6.12
File Interpreter ABI Platform
logging_journald-0.6.12-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / logging_journald-0.6.12.tar.gz

Download URL logging_journald-0.6.12.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d6bd338460b5ecd88f6b3e9a6499a6994c65d5d8296f3aa4830b25a7d7e815a9
BLAKE2b-256 checksum
How to use checksums
71dfc013c3d8f37a351ceb35f166bc9a0a69365655ab13eb4366032e96c6da33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

Release files / logging_journald-0.6.12-py3-none-any.whl

Download URL logging_journald-0.6.12-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b94d1c7082d7a7ddc69f8fc1a6cf420da3d97a03363c12659859fec09f44f811
BLAKE2b-256 checksum
How to use checksums
24f32b2033e02f6a08eaefed14351056b797f780c7f5aaa6765e66d734fac91b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.12 This release

2 release files

0.6.11

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page