{"id":23747,"library":"flask-log-request-id","title":"Flask-Log-Request-ID","description":"Flask extension that parses and handles request IDs from headers like X-Request-ID, X-Correlation-ID, and Amazon TraceId. Supports Flask and Celery workers. Current version: 0.10.1. Release cadence is low (last release 2021).","status":"active","version":"0.10.1","language":"python","source_language":"en","source_url":"http://github.com/Workable/flask-log-request-id","tags":["flask","request-id","logging","celery"],"install":[{"cmd":"pip install flask-log-request-id","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Deprecated Flask extension import pattern (Flask <0.12). Use the modern import.","wrong":"from flask.ext.log_request_id import RequestID","symbol":"RequestID","correct":"from flask_log_request_id import RequestID"},{"note":"Function name changed. The proxy is called current_request_id.","wrong":"from flask.ext.log_request_id import get_current_request_id","symbol":"current_request_id","correct":"from flask_log_request_id import current_request_id"}],"quickstart":{"code":"from flask import Flask\nfrom flask_log_request_id import RequestID, current_request_id\n\napp = Flask(__name__)\nRequestID(app)\n\n@app.route('/')\ndef index():\n    return f\"Request ID: {current_request_id()}\"\n\nif __name__ == '__main__':\n    app.run()","lang":"python","description":"Initialize the extension with your Flask app and use current_request_id() to get the current request ID."},"warnings":[{"fix":"Use from flask_log_request_id import RequestID instead.","message":"The import pattern flask.ext.log_request_id is deprecated since Flask 0.12. Use the modern import flask_log_request_id.","severity":"deprecated","affected_versions":"Flask >=0.12"},{"fix":"Either set an environment variable or use a middleware to inject a test request ID header.","message":"The extension does not work out-of-the-box with debug=True in Flask development server (Werkzeug) because the server does not send request IDs by default.","severity":"gotcha","affected_versions":"all"},{"fix":"Call init_celery(app, celery) or use the Celery integration documented in README.","message":"When using Celery, the request ID is only propagated if you explicitly initialize the extension with the Celery app or use the provided helper.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from flask_log_request_id import current_request_id","cause":"Typo or wrong import path. Common mistake: using 'current_request_id' instead of 'current_request_id' (underscore). Also check if you imported the correct symbol.","error":"AttributeError: module 'flask_log_request_id' has no attribute 'current_request_id'"},{"fix":"Replace with: from flask_log_request_id import RequestID","cause":"Using the deprecated import pattern flask.ext.log_request_id which is not supported in newer Flask versions.","error":"flask.exceptions.ImportError: cannot import name 'RequestID' from 'flask.ext.log_request_id'"},{"fix":"Ensure you are inside a request context, or pass the request ID explicitly to the background task.","cause":"Calling current_request_id() outside of a Flask request context (e.g., in a background thread).","error":"RuntimeError: Working outside of request context."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}