I am using the default logger in Django having the following configuration:
LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' }, 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins', 'console'], 'level': 'ERROR', 'propagate': True, }, }
}
Therefore, whenever I get 500 errors, I correctly receive mail in the admin email id, but it does not send POST JSON request data. I am sending a request as shown below:
curl -X POST -H 'Content-Type: application/json' http://127.0.0.1/api/customer/ -d "{'username':'rajeevnith', 'frist_name': 'Rajeev', 'last_name':'Bahrdwaj'}"
How can we configure django logger to send this request body?
r.bhardwaj
source share