skillfed

multiprocessing-logging

Logger for multiprocessing applications

multiprocessing-logging v0.3.4 242.4K downloads/30d#8,856 on PyPI395
Copyleft license LGPLv3 AGING released

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-logging

uv

uv add multiprocessing-logging

poetry

poetry add multiprocessing-logging

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Operating System :: POSIXProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules

Tags

multiprocessing logging handlersubprocess log aggregationmultiprocessing log tunnelingcentralized multiprocessing logsmultiprocess logger coordinationfork-based process loggingmultiprocessing pool logging
multiprocessinglogging-handlerposix-only

More Python Modules packages