Created
May 26, 2013 13:04
-
-
Save apelliciari/5652725 to your computer and use it in GitHub Desktop.
logging conf + sentry
This file contains hidden or 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, | |
'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': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
'formatter': 'simple', | |
}, | |
# I always add this handler to facilitate separating loggings | |
'debug_log_file':{ | |
'level': 'DEBUG', | |
'class': 'logging.handlers.RotatingFileHandler', | |
'filename': os.path.join(ROOT_PROJECT_INTERNAL, 'logs', 'debug.log'), | |
'maxBytes': '16777216', # 16megabytes | |
'backupCount': 10, | |
'formatter': 'verbose' | |
}, | |
'warning_log_file':{ | |
'level': 'WARNING', | |
'class': 'logging.handlers.RotatingFileHandler', | |
'filename': os.path.join(ROOT_PROJECT_INTERNAL, 'logs', 'warning.log'), | |
'maxBytes': '16777216', # 16megabytes | |
'backupCount': 10, | |
'formatter': 'verbose' | |
}, | |
'django_log_file':{ | |
'level': 'INFO', | |
'class': 'logging.handlers.RotatingFileHandler', | |
'filename': os.path.join(ROOT_PROJECT_INTERNAL, 'logs', 'django.log'), | |
'maxBytes': '16777216', # 16megabytes | |
'backupCount': 10, | |
'formatter': 'verbose' | |
}, | |
}, | |
'loggers': { | |
'django.request': { | |
'handlers': ['mail_admins',], | |
'level': 'ERROR', | |
'propagate': True, | |
}, | |
'core': { | |
'handlers': ['debug_log_file', 'warning_log_file'], | |
'level': 'DEBUG', | |
'propagate': True, | |
} | |
} | |
} | |
# only in the live settings file | |
RAVEN_CONFIG = { | |
'dsn': 'https://[email protected]/xxxx', | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment