Console Logging Example
A snippet showing how to enable console logging in Django.
# settings.py
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {"class": "logging.StreamHandler"},
},
"root": {"handlers": ["console"], "level": "DEBUG"},
}
Explanation:
-
Pair with
DEBUGenv var and structured formatters for better readability. - All logs printed to console/stdout; helpful for local dev and containers.
- Category Logging
- Total Views 367
- Last Modified 07 June, 2026
- Tags #logging #console #debug #output
Next snippet