Created
September 24, 2024 11:48
-
-
Save mthri/03d3e92741c4fc8e6516871ac38e852b to your computer and use it in GitHub Desktop.
print sql query in django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'handlers': { | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
}, | |
'file': { | |
'level': 'DEBUG', | |
'class': 'logging.FileHandler', | |
'filename': os.path.join(BASE_DIR, 'sql_queries.log'), # Log to a file | |
}, | |
}, | |
'loggers': { | |
'django.db.backends': { | |
'level': 'DEBUG', | |
'handlers': ['console', 'file'], # Log to console and file | |
}, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment