Skip to main content

structlog-journald

made-in-vietnam structlog-journald ReadTheDocs Common Changelog

Structlog processor to send logs to journald.

Documentation: https://structlog-journald.readthedocs.io

Installation

To install structlog-journald, run:

pip install structlog-journald

Or with uv:

uv add structlog-journald

Usage

Add the structlog_journald.JournaldProcessor to your list of structlog processors. It will do nothing if the journald socket is not available, in other words, the app was not started by systemd.

To let the log have more useful information, you should also add these processors before JournaldProcessor:

  • CallsiteParameterAdder
  • format_exc_info

Example:

import getpass
import logging
import platform

import structlog

from structlog_journald import JournaldProcessor


structlog.configure(
    processors=[
        structlog.contextvars.merge_contextvars,
        structlog.processors.add_log_level,
        structlog.processors.CallsiteParameterAdder(),
        structlog.processors.format_exc_info,
        structlog.dev.set_exc_info,
        structlog.processors.TimeStamper(fmt='%Y-%m-%d %H:%M:%S', utc=False),
        structlog.processors.EventRenamer('message'),
        JournaldProcessor(),
        # This processor should be added for development environment only.
        structlog.dev.ConsoleRenderer(),
    ],
    # In this example, we want to print log entries of all levels
    wrapper_class=structlog.make_filtering_bound_logger(logging.NOTSET),
    context_class=dict,
    logger_factory=structlog.WriteLoggerFactory(),
    cache_logger_on_first_use=True,
)

log = structlog.stdlib.get_logger()

user = getpass.getuser()


log.info('Current Linux user: %s', user, linux=platform.freedesktop_os_release())
log.warning('This is a warning.', platform=platform.platform())
try:
    int('abc')
except ValueError:
    log.exception('Failed to convert string to integer.')

Journalctl

Metadata

Release files for structlog-journald 1.0.0

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

Source distribution (sdist)

Source distribution for structlog-journald 1.0.0
File Size Uploaded
structlog_journald-1.0.0.tar.gz 125.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for structlog-journald 1.0.0
File Interpreter ABI Platform
structlog_journald-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 131.5 kB

Release files / structlog_journald-1.0.0.tar.gz

Download URL structlog_journald-1.0.0.tar.gz
Size 125.3 kB
Tags Source
SHA-256 checksum
How to use checksums
230bbf8489217bb98058ea146e311eafa49417b8dc46876ecf155d0d51d4cf59
BLAKE2b-256 checksum
How to use checksums
e98d336f540f7592307cdf8a3b445dd3bc87a17891e3ad68717d22b834a4494f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 17, 2026.

Transparency log

Release files / structlog_journald-1.0.0-py3-none-any.whl

Download URL structlog_journald-1.0.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0aa09a7485070ccd58e56754de327d5c1062a06cd222d5128cfe49d0cf5ebc4c
BLAKE2b-256 checksum
How to use checksums
92021835b6d29da8eb5a1d4f8ed1c57259091711084cb1d5d3422e320e9960c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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