Skip to content

Instantly share code, notes, and snippets.

@n37r06u3
Created October 4, 2014 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n37r06u3/4b8216de0be4c966e13b to your computer and use it in GitHub Desktop.
Save n37r06u3/4b8216de0be4c966e13b to your computer and use it in GitHub Desktop.
django logging for windows debug
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'ERROR',
'class': 'logging.StreamHandler',
'filters': ['require_debug_false'],
'formatter': 'simple'
},
'file': {
'level':"ERROR",
'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'verbose',
'filename': 'django-error.log',
'maxBytes': 1024000,
'backupCount': 10,
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'ERROR',
'propagate': True,
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment