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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file logging_journald-0.6.3.tar.gz
.
File metadata
- Download URL: logging_journald-0.6.3.tar.gz
- Upload date:
- Size: 3.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c91a582ad31d7ba2b9fe776bb35db10003e1c41a90a7d0f0aefd13a646ef8a88 |
|
MD5 | 25a1ffccd4a36b8faa07da8a7a98610b |
|
BLAKE2b-256 | 578cc2b7ccd7d4f705bbbcdd70f96ec9261243ab37a7ac2dc9a618284d409e49 |
File details
Details for the file logging_journald-0.6.3-py3-none-any.whl
.
File metadata
- Download URL: logging_journald-0.6.3-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 527db00dbbeda1b67ebb87102db51e7fc341670fbc45e058ee91fd65e31557e5 |
|
MD5 | 664398ed239e1bccd270239e6a9f6355 |
|
BLAKE2b-256 | 01ddd28811d8921b99ed7c99a39e4ca3be80e6b2626eaedb42df4dc1c46c0319 |