-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
63 lines (55 loc) · 1.93 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import os
PROJECT_NAME = 'link_server'
DEBUG = os.getenv('DEBUG', False)
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
SPLUNK_HOST = os.getenv('SPLUNK_HOST', 'splunk.example.com')
SPLUNK_PORT = os.getenv('SPLUNK_PORT', '8089')
SPLUNK_USERNAME = os.getenv('SPLUNK_USERNAME', 'admin')
SPLUNK_PASSWORD = os.getenv('SPLUNK_PASSWORD', 'changeme')
SPLUNK_INDEX = os.getenv('SPLUNK_INDEX', 'main')
SPLUNK_HOSTNAME = os.getenv('SPLUNK_HOSTNAME', 'link.mailbeaker.dev')
SPLUNK_VERIFY = os.getenv('SPLUNK_VERIFY', 'True')
SPLUNK_VERIFY = False if SPLUNK_VERIFY == 'False' else True
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'json': {
'()': 'pythonjsonlogger.jsonlogger.JsonFormatter',
'format': '%(asctime)s %(created)f %(exc_info)s %(filename)s %(funcName)s %(levelname)s %(levelno)s %(lineno)d %(module)s %(message)s %(pathname)s %(process)s %(processName)s %(relativeCreated)d %(thread)s %(threadName)s'
},
'verbose': {
'format': 'levelname=%(levelname)s asctime=%(asctime)s module=%(module)s process=%(process)d thread=%(thread)d message="%(message)s"'
}
},
'handlers': {
'splunk': {
'level': LOG_LEVEL,
'class': 'splunk_handler.SplunkHandler',
'formatter': 'json',
'host': SPLUNK_HOST,
'port': SPLUNK_PORT,
'username': SPLUNK_USERNAME,
'password': SPLUNK_PASSWORD,
'index': SPLUNK_INDEX,
'hostname': SPLUNK_HOSTNAME,
'sourcetype': 'json',
'verify': SPLUNK_VERIFY
},
'console': {
'level': LOG_LEVEL,
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'': {
'handlers': ['console', 'splunk'],
'level': LOG_LEVEL
}
}
}
try:
from settingslocal import *
except ImportError:
pass