multiprocessing-logging
Logger for multiprocessing applications
What it is and what it does
multiprocessing-logging solves the problem of garbled or lost log messages when using Python's multiprocessing module. When subprocesses log independently, their output can interleave or be lost; this package installs a handler on the root logger that tunnels all log records from child processes back to the main process for centralized handling.
The module is simple to use: call `install_mp_handler()` after configuring logging but before spawning processes or creating a Pool. It relies on the fork start method for process creation and works on POSIX systems (Linux officially supported). The documentation notes a known limitation: fork-based process creation is unsafe when threads are also in use, creating a low probability of application hangs; the recommended workaround is to create a Pool once and reuse it rather than continuously spawning new processes.
Use it for:
- Aggregate logs from a multiprocessing.Pool into a single file or stream without interleaving.
- Centralize subprocess logging in a long-running daemon that spawns worker processes.
- Debug parallel workloads by collecting all subprocess output in order at the main process.
- Replace per-subprocess log files with a unified log when using fork-based multiprocessing.
- Ensure log records from child processes reach configured handlers (files, syslog, etc.) in the main process.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a logging handler that tunnels log records from multiprocessing subprocesses to the main process, preventing garbled or lost log messages.
Yes, if you use multiprocessing on Linux and need reliable subprocess logging. The package is stable and has no security vulnerabilities, but maintenance is aging (last release 2023). Install before creating pools or spawning processes, and avoid continuous process creation to mitigate the known fork-threading hang risk. Not suitable for Windows.
Install
multiprocessing-logging on PyPI
pip
pip install multiprocessing-logginguv
uv add multiprocessing-loggingpoetry
poetry add multiprocessing-loggingInstalling multiprocessing-logging
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was in 2023 and no commits since 2026-01-28—but the package is marked Production/Stable and remains archived-free.
License in practice
Licensed under LGPLv3, a copyleft license. You must disclose source code modifications and distribute under the same license if you redistribute the package or derivative works.
Quickstart
import logging
import multiprocessing_logging
logging.basicConfig()
multiprocessing_logging.install_mp_handler()
# Call install_mp_handler() before creating multiprocessing.Pool or spawning subprocesses
Only works on POSIX systems; Linux is officially supported. Does not work on Windows. PyPy3 is not recommended due to test hangs.
Verify before relying
- Whether the fork-based approach and threading interaction issue (low probability of hangs) is acceptable for your workload.
- Current compatibility with Python versions beyond 3.10, given the aging maintenance status.
- Whether PyPy (non-3) support is stable enough for production use in your environment.
Package facts
| License | LGPLv3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 1,286 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 242,418/month — #8,856 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: multiprocessing_logging-0.3.4-py2.py3-none-any.whl
Keywords: multiprocessing, logging, logger, handler
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
concurrent-log-handlerProvides thread-safe and process-safe logging…
permissive · top 5,000 on PyPI
tqdm-multiprocessDisplays multiple tqdm progress bars from…
permissive · top 15,000 on PyPI
seqlogSeqLog sends Python log records to Seq, a…
permissive · top 15,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
aws-logging-handlersRoutes Python logging records to AWS S3 and…
permissive · top 15,000 on PyPI
datadog-loggerSends Python log messages to Datadog as Events…
permissive · top 15,000 on PyPI
cloudwatchA Python logging handler that sends log events…
permissive · top 15,000 on PyPI
fluent-loggerSends structured event logs from Python…
unclear · top 5,000 on PyPI
python-logging-lokiA Python logging handler that sends log records…
permissive · top 5,000 on PyPI
billiardbilliard is a fork of Python's multiprocessing…
permissive · top 1,000 on PyPI