{ "info": { "author": "Konstantinos Paliouras", "author_email": "squarious@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "\nFlask-Log-Request-Id\n====================\n\n|CircleCI|\n\n**Flask-Log-Request-Id** is an extension for `Flask`_ that can parse and handle\nthe request-id sent by request processors like `Amazon ELB`_, `Heroku Request-ID`_\nor any multi-tier infrastructure as the one used at microservices. A common\nusage scenario is to inject the request\\_id in the logging system so that all\nlog records, even those emitted by third party libraries, have attached the\nrequest\\_id that initiated their call. This can greatly improve tracing and debugging of problems.\n\n\nFeatures\n--------\n\nFlask-Log-Request-Id provides the ``current_request_id()`` function which can be used\nat any time to get the request id of the initiated execution chain. It also comes with\nlog filter to inject this information on log events as also an extension to forward\nthe current request id into Celery's workers.\n\n\nExample: Parse request id and send it to to logging\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn the following example, we will use the ``RequestIDLogFilter`` to inject\nthe request id on all log events, and a custom formatter to print this\ninformation. If all these sounds unfamiliar please take a look at `python logging system`_\n\n.. code:: python\n\n import logging\n import logging.config\n from random import randint\n from flask import Flask\n from flask_log_request_id import RequestID, RequestIDLogFilter\n\n def generic_add(a, b):\n \"\"\"Simple function to add two numbers that is not aware of the request id\"\"\"\n logging.debug('Called generic_add({}, {})'.format(a, b))\n return a + b\n\n app = Flask(__name__)\n RequestID(app)\n\n # Setup logging\n handler = logging.StreamHandler()\n handler.setFormatter(\n logging.Formatter(\"%(asctime)s - %(name)s - level=%(levelname)s - request_id=%(request_id)s - %(message)s\"))\n handler.addFilter(RequestIDLogFilter()) # << Add request id contextual filter\n logging.getLogger().addHandler(handler)\n\n\n @app.route('/')\n def index():\n a, b = randint(1, 15), randint(1, 15)\n logging.info('Adding two random numbers {} {}'.format(a, b))\n return str(generic_add(a, b))\n\n\nInstallation\n------------\nThe easiest way to install it is using ``pip`` from PyPI\n\n.. code:: bash\n\n pip install flask-log-request-id\n\n\nLicense\n-------\n\nSee the `LICENSE`_ file for license rights and limitations (MIT).\n\n\n.. _Flask: http://flask.pocoo.org/\n.. _Amazon ELB: http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-request-tracing.html\n.. _Heroku Request-ID: https://devcenter.heroku.com/articles/http-request-id\n.. _python logging system: https://docs.python.org/3/library/logging.html\n.. _LICENSE: https://github.com/Workable/flask-log-request-id/blob/master/LICENSE.md\n.. |CircleCI| image:: https://img.shields.io/circleci/project/github/Workable/flask-log-request-id.svg\n :target: https://circleci.com/gh/Workable/flask-log-request-id\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/Workable/flask-log-request-id", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Flask-Log-Request-ID", "package_url": "https://pypi.org/project/Flask-Log-Request-ID/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Log-Request-ID/", "project_urls": { "Homepage": "http://github.com/Workable/flask-log-request-id" }, "release_url": "https://pypi.org/project/Flask-Log-Request-ID/0.10.0/", "requires_dist": [ "Flask (>=0.8)", "celery (~=4.1.0); extra == 'celery'", "nose; extra == 'test'", "mock (==2.0.0); extra == 'test'", "coverage (~=4.3.4); extra == 'test'", "celery (~=4.1.0); extra == 'test'" ], "requires_python": "", "summary": "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.", "version": "0.10.0" }, "last_serial": 4043879, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "5a4f3f62423ed3e4d058641ad3fa84fb", "sha256": "cd4f4bc5051fb437550793a1ec094149517f77a74b95593b3007ed16f6f1f41c" }, "downloads": -1, "filename": "Flask_Log_Request_ID-0.10.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5a4f3f62423ed3e4d058641ad3fa84fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9764, "upload_time": "2018-01-10T13:48:46", "url": "https://files.pythonhosted.org/packages/92/f9/ed05bbba81a9d24a166bb21a2a22a958045bc517a0ab3a72aef51e4c1e37/Flask_Log_Request_ID-0.10.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cb09ad4f5096d3698a43a144e1e54f1d", "sha256": "c03efde39a9eb7fe0417c946c8f27e7c90a10170a8fac6e417c928bda70d4afb" }, "downloads": -1, "filename": "Flask-Log-Request-ID-0.10.0.tar.gz", "has_sig": false, "md5_digest": "cb09ad4f5096d3698a43a144e1e54f1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7151, "upload_time": "2018-01-10T13:48:48", "url": "https://files.pythonhosted.org/packages/fe/80/8e009005ffa1a0240307d58bf5c572f4374a91389e25e7c9fdbbb138bd4f/Flask-Log-Request-ID-0.10.0.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "99b0d86e68035d077ce852b2d2568efd", "sha256": "071047efc20b1337891e7aea9947bac065db50167ccfee052783101e8c8d3ac9" }, "downloads": -1, "filename": "Flask_Log_Request_ID-0.9.2-py3-none-any.whl", "has_sig": false, "md5_digest": "99b0d86e68035d077ce852b2d2568efd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9548, "upload_time": "2017-09-08T15:05:42", "url": "https://files.pythonhosted.org/packages/cb/87/7527b4c77076b827f6ed5c401bc8e6b681368572268a05cd4fc381bc62f4/Flask_Log_Request_ID-0.9.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2ff4b6881a59f62779ff3bb304343643", "sha256": "1c6032943358f1bf778435770ccaf715cb2ee523ace6911fa18bd9bbdc8bfda7" }, "downloads": -1, "filename": "Flask-Log-Request-ID-0.9.2.tar.gz", "has_sig": false, "md5_digest": "2ff4b6881a59f62779ff3bb304343643", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6860, "upload_time": "2017-09-08T14:53:10", "url": "https://files.pythonhosted.org/packages/f4/18/87d18e450b15565f27bfb6b07780c558ea1a74b4cb522d01bf17a6f54e67/Flask-Log-Request-ID-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "7d5eba1da902b3734816e6d8cce82897", "sha256": "f485d26d51933677c31430cbd637feae7b92bf6c1cf832fd5ef17b5c56afee48" }, "downloads": -1, "filename": "Flask_Log_Request_ID-0.9.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7d5eba1da902b3734816e6d8cce82897", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9565, "upload_time": "2017-09-26T09:47:55", "url": "https://files.pythonhosted.org/packages/73/24/ce76a9c8473d27547abe55cfc185b59c5daa5b043982df5ae8d35e08ba15/Flask_Log_Request_ID-0.9.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87dd21c61dde073e8fc4f9efc90c3844", "sha256": "38ba219f893f3cf3439bf6e31f808a6fca902ae68cb8b05871548de109ea5dc1" }, "downloads": -1, "filename": "Flask-Log-Request-ID-0.9.3.tar.gz", "has_sig": false, "md5_digest": "87dd21c61dde073e8fc4f9efc90c3844", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6911, "upload_time": "2017-09-26T09:47:56", "url": "https://files.pythonhosted.org/packages/3a/6e/ef8b2fbf353385ad3dedd68d9b0fc628f883fc6d1c9b9c2208ada06227e7/Flask-Log-Request-ID-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "4b1858a45df777787d74eaa5b385b5f2", "sha256": "bf2cd650898b29499783b65cca260d73314c58d0e856eb3bc8309fc1192b6500" }, "downloads": -1, "filename": "Flask_Log_Request_ID-0.9.4-py3-none-any.whl", "has_sig": false, "md5_digest": "4b1858a45df777787d74eaa5b385b5f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9683, "upload_time": "2017-09-27T10:29:57", "url": "https://files.pythonhosted.org/packages/c3/70/4a0c794352a27edf634e0ab47fe92a07c7f3e4428cb124638e77ecfbe339/Flask_Log_Request_ID-0.9.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "82cf1bae8aba757b6ee70d10ebacc4c4", "sha256": "1173dc4cbac373ccc43bc79b33e5ac994f901338cec878f1d92f75a0cbf64b6d" }, "downloads": -1, "filename": "Flask-Log-Request-ID-0.9.4.tar.gz", "has_sig": false, "md5_digest": "82cf1bae8aba757b6ee70d10ebacc4c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7026, "upload_time": "2017-09-27T10:29:59", "url": "https://files.pythonhosted.org/packages/fd/9f/07b7e64f2d3cb86c576dc84ae6c5a5cb06d976cd8259ba0ee938e19e0910/Flask-Log-Request-ID-0.9.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a4f3f62423ed3e4d058641ad3fa84fb", "sha256": "cd4f4bc5051fb437550793a1ec094149517f77a74b95593b3007ed16f6f1f41c" }, "downloads": -1, "filename": "Flask_Log_Request_ID-0.10.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5a4f3f62423ed3e4d058641ad3fa84fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9764, "upload_time": "2018-01-10T13:48:46", "url": "https://files.pythonhosted.org/packages/92/f9/ed05bbba81a9d24a166bb21a2a22a958045bc517a0ab3a72aef51e4c1e37/Flask_Log_Request_ID-0.10.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cb09ad4f5096d3698a43a144e1e54f1d", "sha256": "c03efde39a9eb7fe0417c946c8f27e7c90a10170a8fac6e417c928bda70d4afb" }, "downloads": -1, "filename": "Flask-Log-Request-ID-0.10.0.tar.gz", "has_sig": false, "md5_digest": "cb09ad4f5096d3698a43a144e1e54f1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7151, "upload_time": "2018-01-10T13:48:48", "url": "https://files.pythonhosted.org/packages/fe/80/8e009005ffa1a0240307d58bf5c572f4374a91389e25e7c9fdbbb138bd4f/Flask-Log-Request-ID-0.10.0.tar.gz" } ] }