Last active
September 2, 2015 18:17
-
-
Save fdemmer/19013afd63a3d483c31f to your computer and use it in GitHub Desktop.
Simple default debug console logging configuration for 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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'debug': { | |
'format': '%(asctime)s %(levelname)s %(name)s %(funcName)s(%(lineno)d): %(message)s' | |
}, | |
}, | |
'handlers': { | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
'formatter': 'debug' | |
}, | |
'null': { | |
'level': 'DEBUG', | |
'class': 'django.utils.log.NullHandler', | |
}, | |
}, | |
'loggers': { | |
# keep down database noise | |
'django.db': { | |
'handlers': ['null'], | |
'level': 'DEBUG', | |
'propagate': False, | |
}, | |
# get me stack traces on the console | |
'django.request': { | |
'handlers': ['console'], | |
'level': 'DEBUG', | |
'propagate': False, | |
}, | |
# log everything else to console | |
'': { | |
'handlers': ['console'], | |
'level': 'DEBUG', | |
'propagate': False, | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment