Last active
August 29, 2015 14:08
-
-
Save 0atman/c013ff61f02477ecea25 to your computer and use it in GitHub Desktop.
Nice default logging options for Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from http://stackoverflow.com/a/26528507/333294