Skip to content

Instantly share code, notes, and snippets.

@0atman
Last active August 29, 2015 14:08
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 0atman/c013ff61f02477ecea25 to your computer and use it in GitHub Desktop.
Save 0atman/c013ff61f02477ecea25 to your computer and use it in GitHub Desktop.
Nice default logging options for Django
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'error_file': {
'level': 'WARNING',
'filename': os.path.join(BASE_DIR, 'django-error.log'),
'class':'logging.handlers.RotatingFileHandler',
'maxBytes': 1 * 1024 * 1024,
'backupCount': 2
}
},
'loggers': {
'django': {
'handlers': ['error_file'],
'level': 'WARNING',
'propagate': True
}
}
}
@0atman
Copy link
Author

0atman commented Oct 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment