Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cuongnb14/django-request-logging
Django Request Logging is a Django app that logs detailed request information, such as URL, method, headers, and response time. It outputs logs to the console and can optionally store them in the database for long-term tracking
https://github.com/cuongnb14/django-request-logging
django request-logging
Last synced: 1 day ago
JSON representation
Django Request Logging is a Django app that logs detailed request information, such as URL, method, headers, and response time. It outputs logs to the console and can optionally store them in the database for long-term tracking
- Host: GitHub
- URL: https://github.com/cuongnb14/django-request-logging
- Owner: cuongnb14
- License: mit
- Created: 2023-09-22T10:16:54.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-03T04:17:03.000Z (12 days ago)
- Last Synced: 2024-11-03T05:17:35.974Z (12 days ago)
- Topics: django, request-logging
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Django Request Logging
===================Django Request Logging is a Django app that logs detailed request information, such as URL, method, headers, and response time. It outputs logs to the console and can optionally store them in the database for long-term tracking, making it easier to monitor, debug, and analyze user interactions with your application.
Install
=======::
pip install git+https://github.com/cuongnb14/[email protected]#egg=django-request-logging
Setting
=======.. code:: python
INSTALLED_APPS = [
'request_logging',
...
]MIDDLEWARE = [
...
'request_logging.middlewares.RequestLogMiddleware'
]REQUEST_LOGGING = {
'WHITELIST_PATHS': ["/admin/jsi18n/"],
'ENABLE_PYTHON_LOG': True,
'ENABLE_DB_LOG': True,
'DB_LOG_SAMPLE': 1,
'LOG_HEADER_KEYS': ["HTTP_USER_AGENT", "HTTP_X_FORWARDED_FOR", "REMOTE_ADDR", "HTTP_REFERER"],
}Run migrate:
::
python3 manage.py migrate