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.")
MESSAGE_ID field
As defined in catalog documentation:
A
128-bitmessage 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)
| File | Size | Uploaded | |
|---|---|---|---|
| logging_journald-0.6.12.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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