Skip to content

Instantly share code, notes, and snippets.

@camilonova
Created June 25, 2012 20:36
Show Gist options
  • Save camilonova/2991061 to your computer and use it in GitHub Desktop.
Save camilonova/2991061 to your computer and use it in GitHub Desktop.
Default logging for django 1.4
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.db.backends': {
'handlers': ['console'],
'level': 'DEBUG',
},
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment