Skip to content

Instantly share code, notes, and snippets.

@syfun
Created June 1, 2019 02:49
Show Gist options
  • Save syfun/d4ea8b01182cf9135864996889150888 to your computer and use it in GitHub Desktop.
Save syfun/d4ea8b01182cf9135864996889150888 to your computer and use it in GitHub Desktop.
django log config
LOG_LEVEL = 'DEBUG'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
},
},
'handlers': {
'console': {
'level': LOG_LEVEL,
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
},
'loggers': {
# 'django': {
# 'handlers': ['console', ],
# 'level': LOG_LEVEL,
# 'propagate': True
# },
'django.request': {
'handlers': ['console', ],
'level': LOG_LEVEL,
'propagate': True
},
'django.db.backends': {
'handlers': ['console'],
'level': LOG_LEVEL,
'propagate': True
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment