django-request-logging | Django middleware that logs http request body | HTTP library
kandi X-RAY | django-request-logging Summary
kandi X-RAY | django-request-logging Summary
Django middleware that logs http request body.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Log an error
- Log a message
- Get the package version
- Logs a message to the console
- Log an error message
- Read content of file
django-request-logging Key Features
django-request-logging Examples and Code Snippets
Community Discussions
Trending Discussions on django-request-logging
QUESTION
I am trying to enable email alerts when HTTP 500 errors happens. Everything works fine, except that a Authentication credentials were not provided
(HTTP 401) error is logged at ERROR
level, which is way too verbose for email alerts.
Here is the email content (Django settings omitted here):
Report at /
[35mb'{"detail":"Authentication credentials were not provided."}' [0m
Request Method: GET
Request URL: https://myapi.org/dev/
Django Version: 2.0.2
Python Executable: /var/lang/bin/python3.6
Python Version: 3.6.1
Also, I am using the django-request-logging
module to print requests' content.
Here is my logging config:
...ANSWER
Answered 2018-Sep-05 at 03:08From the documentation for django-request-logger
:
If HTTP status code is between 400 - 599, URIs are logged at ERROR level, otherwise they are logged at INFO level.
See
REQUEST_LOGGING_HTTP_4XX_LOG_LEVEL
setting to override this.
And the documentation for that setting explains how to change the log level:
By default, HTTP status codes between 400 - 499 are logged at
ERROR
level. You can setREQUEST_LOGGING_HTTP_4XX_LOG_LEVEL = logging.WARNING
(etc) to override this.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-request-logging
You can use django-request-logging like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page