I'm using Django==2.2.11 and djangorestframework==3.11.0.
When I run ./manage.py runserver
and make an http request to the endpoint that has some database queries I got all the logging information. This is only when DEBUG = True
. If I set DEBUG=False
I won't get any logging to console at all:
settings.py:
DEBUG = False
LOGGING = {
'version': 1,
'handlers': {
'console': {
'level': 'DEBUG',
'filters': [],
'class': 'logging.StreamHandler',
}
},
'loggers': {
'django.db.backends': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False
},
'django.request': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': False
},
}
}