Created
January 10, 2018 09:25
-
-
Save mjtamlyn/f640dfac2a4f4a2568f2ca13ba178390 to your computer and use it in GitHub Desktop.
Logging config
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': 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': { | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
'formatter': 'simple' | |
}, | |
'sentry': { | |
'level': 'ERROR', | |
'filters': ['require_debug_false'], | |
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler' | |
} | |
}, | |
'loggers': { | |
'root': {'level': 'WARN', 'handlers': ['sentry', 'console']}, | |
'django': { | |
'handlers': ['sentry', 'console'], | |
'level': 'INFO' if DEBUG else 'WARN', | |
'propagate': True, | |
}, | |
'factory': { | |
'level': 'WARN', | |
'handles': ['console'], | |
}, | |
'api': {'level': 'ERROR', 'handlers': ['sentry']}, | |
# ... various other project specific loggers, lines like the above one | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment