Flask-Log-Request-ID
Flask extension that can parse and handle multiple types of request-id sent by request processors like Amazon ELB, Heroku or any multi-tier infrastructure as the one used for microservices.
What it is and what it does
Flask-Log-Request-ID is a Flask extension that captures request IDs from HTTP headers (commonly set by load balancers like Amazon ELB or Heroku) and makes them available throughout your application's request lifecycle. It provides a RequestIDLogFilter that automatically injects the request ID into all log records, including those from third-party libraries, enabling you to trace a single user request across multiple services and log files.
The package is designed for microservices and multi-tier infrastructure where a request passes through several layers. By attaching the same request ID to every log entry, you can correlate logs across services and dramatically simplify debugging. It exposes a current_request_id() function to retrieve the ID at any point in your code, and includes support for forwarding the request ID to Celery workers.
Use it for:
- Correlate logs across multiple Flask microservices by injecting a common request ID into all log records.
- Debug production issues by tracing a single user request through multiple services using a unified request ID.
- Forward request IDs to background Celery tasks so async work maintains the same tracing context.
- Integrate with load balancer request tracing (ELB, Heroku) to preserve infrastructure-level request IDs in application logs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts request IDs from incoming HTTP requests (from load balancers or infrastructure) and injects them into Flask application logs for distributed tracing.
Yes, with caution. The package is simple, stable, and solves a real problem in microservice logging. However, maintenance is dormant since 2019 with no recent commits—test compatibility with your Flask version before deploying to production. If you need active support or are using very recent Flask releases, consider whether a more actively maintained alternative exists.
Install
flask-log-request-id on PyPI
pip
pip install flask-log-request-iduv
uv add flask-log-request-idpoetry
poetry add flask-log-request-idInstalling Flask-Log-Request-ID
Before you install
Low friction: single runtime dependency on Flask, pure Python wheel. Maintenance is dormant—last release October 2019, no commits since July 2024—but the package is stable and archived repository shows no active development planned.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install flask-log-request-id
import logging
from flask import Flask
from flask_log_request_id import RequestID, RequestIDLogFilter
app = Flask(__name__)
RequestID(app)
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(request_id)s - %(message)s"))
handler.addFilter(RequestIDLogFilter())
logging.getLogger().addHandler(handler)
Verify before relying
- Whether the package works correctly with modern Flask versions (3.0+) given the dormant maintenance status since 2019.
- Compatibility with current Python versions and whether any undocumented breaking changes exist in recent Flask releases.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Flask |
| Maintenance | dormant — 2,479 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 121,332/month — #11,985 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Flask_Log_Request_ID-0.10.1-py3-none-any.whl
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
django-request-idAttaches a unique request ID to each Django…
permissive · top 15,000 on PyPI
django-log-request-idAttaches a unique request ID to every log…
permissive · top 15,000 on PyPI
flask-request-id-headerFlask middleware that automatically adds or…
unclear · top 15,000 on PyPI
asgi-correlation-idASGI middleware that reads or generates…
permissive · top 5,000 on PyPI
opencensus-ext-flaskAdds distributed tracing instrumentation to…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-flaskAdds distributed tracing to Flask web…
permissive · top 1,000 on PyPI
django-cidAssigns unique correlation IDs to incoming HTTP…
permissive · top 15,000 on PyPI
python-logstashSends Python log records to Logstash over UDP…
permissive · top 15,000 on PyPI
logging-azure-restProvides a Python logging handler that…
permissive · top 5,000 on PyPI
Flask-InjectorIntegrates dependency injection into Flask…
permissive · top 15,000 on PyPI