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 DEBUG env 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
Custom Log Formatter
Never miss a story on Django.wiki

Subscribe for fresh tutorials, snippets, and updates.

By subscribing you agree to our Privacy Policy.