本文整理匯總了Python中raven.contrib.django.handlers.SentryHandler.setLevel方法的典型用法代碼示例。如果您正苦於以下問題:Python SentryHandler.setLevel方法的具體用法?Python SentryHandler.setLevel怎麽用?Python SentryHandler.setLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類raven.contrib.django.handlers.SentryHandler
的用法示例。
在下文中一共展示了SentryHandler.setLevel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SentryHandler
# 需要導入模塊: from raven.contrib.django.handlers import SentryHandler [as 別名]
# 或者: from raven.contrib.django.handlers.SentryHandler import setLevel [as 別名]
SENTRY_CACHE_BACKEND = 'default'
EMAIL_SUBJECT_PREFIX = '[Sentry] '
# Configure logging
from raven.conf import setup_logging
from raven.contrib.django.handlers import SentryHandler
import logging
# Configure root logger
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
logger.addHandler(handler)
# Disable django.request as it's generally useless
logger = logging.getLogger('django.request')
logger.propagate = False
logger.addHandler(handler)
# Configure default sentry logging
sentry_handler = SentryHandler()
sentry_handler.setLevel(logging.ERROR)
setup_logging(sentry_handler)
# Configure celery
import djcelery
djcelery.setup_loader()