Skip to content
Snippets Groups Projects
Commit bc3a66ec authored by Agustin Dorda's avatar Agustin Dorda
Browse files

APM y logs para todos

parent 3c271812
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@ You should have received a copy of the GNU General Public License along with thi
"""
APP_ROOT = '/opt/project/'
LOG_ROOT = APP_ROOT + 'logs/'
STATIC_ROOT = APP_ROOT + 'html/'
ACCOUNT_ADDRESS = '0x25c185dcaed065bac30a0a1cd0688a7aa02896d7'
......
......@@ -8,6 +8,8 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
"""
# -*- coding: utf-8 -*-
import sys
"""
Django settings for TsaApi project.
......@@ -51,7 +53,7 @@ INSTALLED_APPS = [
'raven.contrib.django.raven_compat',
'corsheaders',
'rest_framework_swagger',
'elasticapm.contrib.django'
'elasticapm.contrib.django',
'app'
]
......@@ -157,6 +159,9 @@ REST_FRAMEWORK = {
),
}
APP_ROOT = '/var/www/tsaapi.prod.bfa.local/'
LOG_ROOT = APP_ROOT + 'logs/'
SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54'
MEMCACHED_HOST = ''
......@@ -169,36 +174,76 @@ TEST_MEMCACHED_PORT = ''
TEST_PENDING_TXS_MEMCACHED_KEY = 'test_pending_txs'
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi',
'SERVER_URL': 'http://10.1.100.67:8200',
'DEBUG': False,
}
try:
from TsaApi.local_settings import *
except ImportError as e:
pass
RAVEN_CONFIG = {
'dsn': SENTRY_URL,
}
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'detailed': {
'format': '%(levelname)s %(asctime)s %(filename)s %(funcName)s %(lineno)d %(message)s',
},
'history': {
'format': '%(asctime)s %(message)s'
}
},
'handlers': {
'file': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'stream': sys.stdout,
'formatter': 'detailed'
},
'info_file': {
'level': 'INFO',
'class': 'logging.FileHandler',
'filename': '/path/to/django/debug.log',
'filename': LOG_ROOT + 'info.log',
'formatter': 'history',
},
'error_file': {
'level': 'ERROR',
'class': 'logging.FileHandler',
'filename': LOG_ROOT + 'error.log',
'formatter': 'detailed',
},
'sentry': {
'level': 'ERROR', # To capture more than ERROR, change to WARNING, INFO, etc.
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
}
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'handlers': ['error_file', 'info_file', 'sentry'],
'level': 'WARNING',
'propagate': True,
},
'raven': {
'level': 'WARNING',
'handlers': ['sentry'],
'propagate': False,
},
'logger': {
'handlers': ['error_file', 'info_file', 'sentry'],
'level': 'ERROR',
'propagate': True,
},
'console-logger': {
'handlers': ['console', 'info_file', 'error_file', 'sentry'],
'progagate': True,
'level': 'DEBUG'
}
},
}
ELASTIC_APM = {
'SERVICE_NAME' : 'TsaApi',
'SERVER_URL': 'http://10.1.100.67:8200',
'DEBUG': False,
}
try:
from TsaApi.local_settings import *
except ImportError as e:
pass
RAVEN_CONFIG = {
'dsn': SENTRY_URL,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment