Skip to content

Instantly share code, notes, and snippets.

@rh0dium
Created February 10, 2013 23:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rh0dium/4751482 to your computer and use it in GitHub Desktop.
Save rh0dium/4751482 to your computer and use it in GitHub Desktop.
Another..
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': "[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s",
'datefmt': "%d/%b/%Y %H:%M:%S"
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'()': 'logutils.colorize.ColorizingStreamHandler',
'formatter': 'standard',
'stream': sys.stdout
},
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
'include_html': True,
},
'logfile': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': "./django.log",
'maxBytes': 50000,
'backupCount': 2,
'formatter': 'standard',
},
},
'loggers': {
'django': {
'handlers': ['console', 'logfile'],
'propagate': True,
'level': 'ERROR',
},
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': False,
},
'': {
'handlers': ['console', 'logfile'],
'level': os.environ.get('AXIS_DEBUG_LEVEL', 'ERROR'),
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment