Last active
July 4, 2019 16:32
-
-
Save rsarai/78efb91c47f11317fdd2e26bd4a603da to your computer and use it in GitHub Desktop.
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
# Celery | |
CELERY_SEND_TASK_ERROR_EMAILS = True | |
CELERYD_HIJACK_ROOT_LOGGER = False | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'root': { | |
'level': 'INFO', | |
'handlers': ['console', 'sentry'], | |
}, | |
'filters': { | |
'require_debug_false': { | |
'()': 'django.utils.log.RequireDebugFalse' | |
}, | |
'request_id': { | |
'()': 'log_request_id.filters.RequestIDFilter' | |
}, | |
'ip_address': { | |
'()': 'common.log_filters.IPAddressFilter' | |
}, | |
}, | |
'formatters': { | |
'standard': { | |
'format': '%(levelname)-8s [%(asctime)s] [%(ip_address)s] [%(request_id)s] %(name)s: %(message)s' | |
}, | |
}, | |
'handlers': { | |
'null': { | |
'class': 'logging.NullHandler', | |
}, | |
'mail_admins': { | |
'level': 'ERROR', | |
'class': 'django.utils.log.AdminEmailHandler', | |
'filters': ['require_debug_false'], | |
}, | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
'filters': ['request_id', 'ip_address'], | |
'formatter': 'standard', | |
}, | |
'sentry': { | |
'level': 'ERROR', # To capture more than ERROR, change to WARNING, INFO, etc. | |
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler', | |
'tags': {'custom-tag': 'x'}, | |
}, | |
}, | |
'loggers': { | |
'': { | |
'handlers': ['console', 'sentry'], | |
'level': 'INFO' | |
}, | |
'django.security.DisallowedHost': { | |
'handlers': ['null'], | |
'propagate': False, | |
}, | |
'django.request': { | |
'handlers': ['mail_admins'], | |
'level': 'ERROR', | |
'propagate': True, | |
}, | |
'log_request_id.middleware': { | |
'handlers': ['console'], | |
'level': 'DEBUG', | |
'propagate': False, | |
}, | |
'django.db.backends': { | |
'level': 'ERROR', | |
'handlers': ['console'], | |
'propagate': False, | |
}, | |
'raven': { | |
'level': 'DEBUG', | |
'handlers': ['console'], | |
'propagate': False, | |
}, | |
'sentry.errors': { | |
'level': 'ERROR', | |
'handlers': ['console'], | |
'propagate': False, | |
}, | |
'celery.task':{ | |
'handlers': ['console', 'sentry'], | |
'level': 'DEBUG', | |
'propagate': False, | |
}, | |
'celery':{ | |
'handlers': ['console', 'sentry'], | |
'level': 'ERROR', | |
'propagate': False, | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment