Last active
October 30, 2016 08:16
-
-
Save bluethon/a53a95eca8acf4c412cd7140fe6a04a8 to your computer and use it in GitHub Desktop.
From https://micropyramid.com/blog/using-sentry-to-track-django-live-events/
add these to the settings.py
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
RAVEN_CONFIG = { | |
'dsn': '<your-dsn-here>', | |
} | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'root': { | |
'level': 'WARNING', | |
'handlers': ['sentry'], | |
}, | |
'formatters': { | |
'verbose': { | |
'format': '%(levelname)s %(asctime)s %(module)s ' | |
'%(process)d %(thread)d %(message)s' | |
}, | |
}, | |
'handlers': { | |
'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'}, | |
}, | |
'console': { | |
'level': 'DEBUG', | |
'class': 'logging.StreamHandler', | |
'formatter': 'verbose' | |
} | |
}, | |
'loggers': { | |
'django.db.backends': { | |
'level': 'ERROR', | |
'handlers': ['console'], | |
'propagate': False, | |
}, | |
'raven': { | |
'level': 'DEBUG', | |
'handlers': ['console'], | |
'propagate': False, | |
}, | |
'sentry.errors': { | |
'level': 'DEBUG', | |
'handlers': ['console'], | |
'propagate': False, | |
}, | |
}, | |
} | |
INSTALLED_APPS = INSTALLED_APPS + ['raven.contrib.django.raven_compat',] | |
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + [ | |
'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware', | |
'raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware', | |
] |
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
from sentry.conf.server import * | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'sentry', | |
'USER': 'root', | |
'PASSWORD': 'root', | |
'HOST': '127.0.0.1', | |
'PORT': '3306', | |
} | |
} | |
SENTRY_USE_BIG_INTS = True | |
SENTRY_ADMIN_EMAIL = 'thesedays@126.com' | |
SENTRY_SINGLE_ORGANIZATION = True | |
SENTRY_REDIS_OPTIONS = { | |
'hosts': { | |
0: { | |
'host': '127.0.0.1', | |
'port': 6379, | |
} | |
} | |
} | |
SENTRY_CACHE = 'sentry.cache.redis.RedisCache' | |
CELERY_ALWAYS_EAGER = False | |
BROKER_URL = 'redis://localhost:6379' | |
SENTRY_RATELIMITER = 'sentry.ratelimits.redis.RedisRateLimiter' | |
SENTRY_BUFFER = 'sentry.buffer.redis.RedisBuffer' | |
SENTRY_QUOTAS = 'sentry.quotas.redis.RedisQuota' | |
SENTRY_TSDB = 'sentry.tsdb.redis.RedisTSDB' | |
SENTRY_FILESTORE = 'django.core.files.storage.FileSystemStorage' | |
SENTRY_FILESTORE_OPTIONS = { | |
'location': '/tmp/sentry-files', | |
} | |
SENTRY_URL_PREFIX = 'http://192.168.216.130:9090' # No trailing slash! | |
SENTRY_WEB_HOST = '192.168.216.130' | |
SENTRY_WEB_PORT = 9090 | |
SENTRY_WEB_OPTIONS = { | |
'daemon': True | |
} | |
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | |
EMAIL_HOST = 'localhost' | |
EMAIL_HOST_PASSWORD = '' | |
EMAIL_HOST_USER = '' | |
EMAIL_PORT = 25 | |
EMAIL_USE_TLS = False | |
SERVER_EMAIL = 'sentry@localhost' | |
MAILGUN_API_KEY = '' | |
SECRET_KEY = 'vPOiwxMjn6RdW78CgSQzky6ihXO56V+1+BFVd92lEfsfdN0wvvIhQw==' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment