Add sentry logging
parent
75aca7ad9d
commit
30ba651dfe
30
env-dist
30
env-dist
|
@ -1,9 +1,22 @@
|
|||
ENVIRONMENT='dev'
|
||||
DEBUG=True
|
||||
|
||||
# Email
|
||||
DEFAULT_FROM_EMAIL=SatNOGS <noreply@satnogs.org>
|
||||
ADMINS_FROM_NAME=Admins
|
||||
ADMINS_FROM_EMAIL=noreply@satnogs.org
|
||||
|
||||
# Security
|
||||
SECRET_KEY=something_long_and_random
|
||||
ALLOWED_HOSTS=localhost
|
||||
|
||||
# Database
|
||||
DATABASE_URL='sqlite:///db.sqlite3'
|
||||
|
||||
# Mapbox
|
||||
MAPBOX_TOKEN=enter_mapbox_token_here
|
||||
MAPBOX_MAP_ID=pierros.jbf6la1j
|
||||
|
||||
# Application
|
||||
DB_API_ENDPOINT='https://db.satnogs.org/api/'
|
||||
|
||||
|
@ -11,3 +24,20 @@ DB_API_ENDPOINT='https://db.satnogs.org/api/'
|
|||
CACHE_BACKEND = 'django.core.cache.backends.locmem.LocMemCache'
|
||||
CACHE_LOCATION = 'unique-snowflake'
|
||||
CACHE_CLIENT_CLASS = None
|
||||
|
||||
# Celery
|
||||
CELERY_BROKER_URL=redis://redis:6379/0
|
||||
CELERY_RESULT_BACKEND=redis://redis:6379/0
|
||||
|
||||
# Archive.org
|
||||
#S3_ACCESS_KEY='s3_access_key'
|
||||
#S3_SECRET_KEY='s3_secret_key'
|
||||
#ARCHIVE_COLLECTION='collection_name'
|
||||
|
||||
# Compressor
|
||||
COMPRESS_ENABLED=False
|
||||
COMPRESS_OFFLINE=False
|
||||
|
||||
# Raven - sentry
|
||||
RAVEN_ENABLED=False
|
||||
#RAVEN_DSN='sentry_dsn'
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
from decouple import config, Csv
|
||||
from dj_database_url import parse as db_url
|
||||
from unipath import Path
|
||||
import os
|
||||
import raven
|
||||
|
||||
ROOT = Path(__file__).parent.parent
|
||||
|
||||
|
@ -28,6 +30,7 @@ THIRD_PARTY_APPS = (
|
|||
'allauth.account',
|
||||
'compressor',
|
||||
'csp',
|
||||
'raven.contrib.django.raven_compat',
|
||||
)
|
||||
LOCAL_APPS = (
|
||||
'network.users',
|
||||
|
@ -166,7 +169,11 @@ AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
|
|||
# Logging
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'disable_existing_loggers': True,
|
||||
'root': {
|
||||
'level': 'WARNING',
|
||||
'handlers': ['sentry'],
|
||||
},
|
||||
'formatters': {
|
||||
'verbose': {
|
||||
'format': '%(levelname)s %(asctime)s %(module)s - %(process)d %(thread)d - %(message)s'
|
||||
|
@ -178,6 +185,11 @@ LOGGING = {
|
|||
}
|
||||
},
|
||||
'handlers': {
|
||||
'sentry': {
|
||||
'level': 'ERROR',
|
||||
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
|
||||
'tags': {'custom-tag': 'x'},
|
||||
},
|
||||
'console': {
|
||||
'level': 'DEBUG',
|
||||
'class': 'logging.StreamHandler',
|
||||
|
@ -200,9 +212,34 @@ LOGGING = {
|
|||
'handlers': ['console'],
|
||||
'propagate': False,
|
||||
},
|
||||
'django.db.backends': {
|
||||
'level': 'ERROR',
|
||||
'handlers': ['console'],
|
||||
'propagate': False,
|
||||
},
|
||||
'raven': {
|
||||
'level': 'DEBUG',
|
||||
'handlers': ['console'],
|
||||
'propagate': False,
|
||||
},
|
||||
'sentry.errors': {
|
||||
'level': 'DEBUG',
|
||||
'handlers': ['console'],
|
||||
'propagate': False,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
# Raven - Sentry
|
||||
RAVEN_ENABLED = config('RAVEN_ENABLED', default=False)
|
||||
if RAVEN_ENABLED:
|
||||
RAVEN_CONFIG = {
|
||||
'dsn': config('RAVEN_DSN', default=''),
|
||||
'release': raven.fetch_git_sha(os.path.abspath(os.curdir)),
|
||||
}
|
||||
else:
|
||||
RAVEN_CONFIG = {}
|
||||
|
||||
# Celery
|
||||
CELERY_ENABLE_UTC = USE_TZ
|
||||
CELERY_TIMEZONE = TIME_ZONE
|
||||
|
@ -286,8 +323,8 @@ MAPBOX_TOKEN = config('MAPBOX_TOKEN', default='')
|
|||
|
||||
# Observations settings
|
||||
# Datetimes in minutes for scheduling OPTIONS
|
||||
OBSERVATION_DATE_MIN_START = config('OBSERVATION_DATE_MIN_START', default=15, cast=int)
|
||||
OBSERVATION_DATE_MIN_END = config('OBSERVATION_DATE_MIN_START', default=25, cast=int)
|
||||
OBSERVATION_DATE_MIN_START = config('OBSERVATION_DATE_MIN_START', default=5, cast=int)
|
||||
OBSERVATION_DATE_MIN_END = config('OBSERVATION_DATE_MIN_END', default=65, cast=int)
|
||||
# Deletion range in minutes
|
||||
OBSERVATION_DATE_MAX_RANGE = config('OBSERVATION_DATE_MAX_RANGE', default=2880, cast=int)
|
||||
# Clean up threshold in days
|
||||
|
@ -297,14 +334,14 @@ OBSERVATION_OLD_RANGE = config('OBSERVATION_OLD_RANGE', default=30, cast=int)
|
|||
# Heartbeat for keeping a station online in minutes
|
||||
STATION_HEARTBEAT_TIME = config('STATION_HEARTBEAT_TIME', default=60, cast=int)
|
||||
# Maximum window for upcoming passes in hours
|
||||
STATION_UPCOMING_END = config('STATION_UPCOMING_END', default=12, cast=int)
|
||||
STATION_UPCOMING_END = config('STATION_UPCOMING_END', default=24, cast=int)
|
||||
WIKI_STATION_URL = config('WIKI_STATION_URL', default='https://wiki.satnogs.org/')
|
||||
|
||||
# DB API
|
||||
DB_API_ENDPOINT = config('DB_API_ENDPOINT', default='https://db.satnogs.org/api/')
|
||||
|
||||
# ListView pagination
|
||||
ITEMS_PER_PAGE = 25
|
||||
ITEMS_PER_PAGE = config('ITEMS_PER_PAGE', default=25, cast=int)
|
||||
|
||||
# User settings
|
||||
AVATAR_GRAVATAR_DEFAULT = config('AVATAR_GRAVATAR_DEFAULT', default='mm')
|
||||
|
|
|
@ -29,6 +29,10 @@ redis==2.10.6 \
|
|||
django-redis-cache==1.7.1 \
|
||||
--hash=sha256:2b4e3510bbcaf3d331975717afd6f15a36fbaf7622504599d2727dc99f90c64d
|
||||
|
||||
# Logging
|
||||
raven==6.9.0 \
|
||||
--hash=sha256:95f44f3ea2c1b176d5450df4becdb96c15bf2632888f9ab193e9dd22300ce46a
|
||||
|
||||
# Security
|
||||
django-braces==1.12.0 \
|
||||
--hash=sha256:7c5b91c75240ccf2eb124fe3b09dd4978e8f4d412b553bb791920bd55839159c \
|
||||
|
@ -232,3 +236,5 @@ clint==0.5.1 \
|
|||
backports.csv==1.0.5 \
|
||||
--hash=sha256:d3b0cefaaca92be3d2d4ceec140827cae1d871da7fff5db70697d72328357d65 \
|
||||
--hash=sha256:8c421385cbc6042ba90c68c871c5afc13672acaf91e1508546d6cda6725ebfc6
|
||||
contextlib2==0.5.5 \
|
||||
--hash=sha256:f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00
|
||||
|
|
Loading…
Reference in New Issue