I am relatively new to django. I recently deployed my application on a web server, and I find it very hard to debug issues. I am getting a 400 Http status code for some of my requests and not sure why. I am trying to increase the level of logs in order to find the root cause for it. However, the output of the logs in not very informative. I am using this configuration for logging (DEBUG is enabled):
logging.config.dictConfig({
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'console': {
'format': '%(name)-12s %(levelname)-8s %(message)s'
},
'file': {
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'console'
},
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'formatter': 'file',
'filename': '/var/log/django/debug.log'
}
},
'loggers': {
'': {
'level': 'DEBUG',
'handlers': ['console', 'file']
}
}
})
This is the output that I am getting in the logs:
2021-11-18 16:18:59,667 django.request WARNING Bad Request: /create
How can I increase the verbosity of the logs to be more informative?