{"id":18974169,"url":"https://github.com/eht16/django-request-logger","last_synced_at":"2026-04-08T08:30:17.909Z","repository":{"id":14885784,"uuid":"17609427","full_name":"eht16/django-request-logger","owner":"eht16","description":"A simple app to configure a common logging setup for Django projects","archived":false,"fork":false,"pushed_at":"2016-11-06T09:52:12.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T08:44:29.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eht16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-10T21:36:25.000Z","updated_at":"2016-11-06T09:52:13.000Z","dependencies_parsed_at":"2022-07-22T09:22:40.081Z","dependency_job_id":null,"html_url":"https://github.com/eht16/django-request-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eht16%2Fdjango-request-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eht16%2Fdjango-request-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eht16%2Fdjango-request-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eht16%2Fdjango-request-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eht16","download_url":"https://codeload.github.com/eht16/django-request-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239971373,"owners_count":19727151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T15:14:17.716Z","updated_at":"2026-04-08T08:30:17.836Z","avatar_url":"https://github.com/eht16.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Overview\n========\n\nA simple app to configure a common logging setup for Django projects.\nThis app re-configures Django's logging setup, build (or read from\npassed HTTP headers) a unique request-id and add a filter to enrich\nlog records with information from the request (status code,\npath, user, ...) and add the previously created request-id to\nthe log record.\n\nThis is most probably not useful to anyone else, it's quite tailored\nto my personal needs and is not very configurable (on purpose).\n\n\nThe RequestIDMiddleware class is based on https://github.com/dabapps/django-log-request-id.\n\n\nDISCLAIMER\n==========\n\nThis is not a general purpose app. This is tailored for my own personal use\nand should not be used unmodified by others.\nHowever, you may use it to learn or to adjust it to  your needs.\nStill, these are not the best practices ever and the code might be buggy.\n\n\nInstallation\n============\n- Install:\n`pip install git+git://github.com/eht16/django-request-logger#egg=django-request-logger`\n\n- Add middleware \"django_request_logger.middleware.RequestIDMiddleware\" to MIDDLEWARE_CLASSES (ideally near the top):\n\n```python\nMIDDLEWARE_CLASSES = (\n    \"...\",\n    \"django_request_logger.middleware.RequestIDMiddleware\",\n    \"...\",\n)\n```\n\n- Add to \"django_request_logger\" to INSTALLED_APPS if you want manage commands also have logged\n\n- Configure log file path in settings.py:\n\n```python\nDJANGO_REQUEST_LOGFILE = '/var/log/django/myproject.log'\n```\n\n- Other settings in settings.py:\n\n```python\n# add the request-id to the response HTTP headers, e.g. for logging with Lighttpd\n# set this to resulting header name which should be added, set to None or unset to disable\nDJANGO_REQUEST_SET_REQUEST_ID_HEADER = 'X-LIGHTTPD-REQUESTID'\n# read an already existing request-id from the request HTTP headers, e.g. set by a webserver\n# set this to given header name which should be added, set to None or unset to disable\nDJANGO_REQUEST_LOG_REQUEST_ID_HEADER = 'HTTP_X_REQUEST_ID'\n# disable any logging config in this app, may be useful for local development/debugging\nDJANGO_REQUEST_ENABLE = False\n```\n\n\nLicense\n=======\n\nCopyright (c) 2014, Enrico Tröger \u003cenrico(dot)troeger(at)uvena(dot)de\u003e\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n    * Neither the name django-wakawaka nor the names of its contributors\n      may be used to endorse or promote products derived from this software without\n      specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feht16%2Fdjango-request-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feht16%2Fdjango-request-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feht16%2Fdjango-request-logger/lists"}