Skip to content

Instantly share code, notes, and snippets.

@bendavis78
Created April 15, 2011 17:09
Show Gist options
  • Save bendavis78/922049 to your computer and use it in GitHub Desktop.
Save bendavis78/922049 to your computer and use it in GitHub Desktop.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(asctime)s - %(name)s - %(levelname)s: %(message)s',
},
'simple': {
'format': '%(levelname)s: %(message)s',
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
'logfile': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': '/dev/null',
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 10,
'formatter': 'verbose',
}
},
'loggers': {
'django.request':{
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'switchboard': {
'handlers': ['console'],
'level': 'INFO',
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment