Skip to content

Instantly share code, notes, and snippets.

@akshayjai1
Created May 8, 2022 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshayjai1/82ff6d491f6b5a259e7becaf065cee46 to your computer and use it in GitHub Desktop.
Save akshayjai1/82ff6d491f6b5a259e7becaf065cee46 to your computer and use it in GitHub Desktop.
logging sql queries for django
LOGGING = {
'version': 1,
'filters': {
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue',
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'filters': ['require_debug_true'],
'class': 'logging.StreamHandler',
}
},
'loggers': {
'django.db.backends': {
'level': 'DEBUG',
'handlers': ['console'],
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment