Skip to content

Instantly share code, notes, and snippets.

@haroldrandom
Created October 25, 2018 07:41
Show Gist options
  • Save haroldrandom/3798330a0ba7910b920e241cfc3efc39 to your computer and use it in GitHub Desktop.
Save haroldrandom/3798330a0ba7910b920e241cfc3efc39 to your computer and use it in GitHub Desktop.
Setup SQL query logging in Django
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
}
},
'loggers': {
'django.db.backends': {
'handlers': ['console'],
'level': 'DEBUG',
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment