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

Uploaded Source

Built Distribution

logging_journald-0.6.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: logging_journald-0.6.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for logging_journald-0.6.4.tar.gz
Algorithm Hash digest
SHA256 a03aa0a1b85ab5f3cdc534511d98ff55f58479e44fbf4e9eb5b965923cbb0c27
MD5 9844af997bb9627aac0b588ea87bf23f
BLAKE2b-256 18820a5855692239f89d3e131aa1c9acb2fa41bdc5a8f9344b3469e28885aaeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: logging_journald-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for logging_journald-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4d4e169cf2814ddbc30687daef2ce38a58a0ec9cd7d739f21f0fb745c4a70ee9
MD5 72e1efea21fecc5f4adcdd6a91ae7b9a
BLAKE2b-256 34fc29908c67b59e6600c9c2b8f1c6b578c474c25bfe51f55b36b198c1a24992

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