forked from twilio/shadow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshadow.conf.py
95 lines (81 loc) · 2.62 KB
/
shadow.conf.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Application parameters
ui = {
'port': 9000,
'address': '0.0.0.0',
}
proxy = {
# address and port shadow runs on
'address': '0.0.0.0',
'port': 8081,
# old server or server containing existing code
'old_servers': ['http://localhost:8081/'],
'old_servers_timeout': 15.0,
'old_servers_additional_get_params': [],
'old_servers_additional_post_params': [],
'old_servers_additional_headers': [],
# new server or server contain new code
'new_servers': ['http://localhost:8081/'],
'new_servers_timeout': 15.0,
'new_servers_additional_get_params': [],
'new_servers_additional_post_params': [],
'new_servers_additional_headers': [],
}
# Daemon params
# chroot = "/mnt/services/shadow/chroot"
user = "nobody"
service = 'shadow.service.ShadowService'
program_name = "shadow"
import os
debug = False
file_prefix = './logs/'
logconfig = {
'version': 1,
'formatters': {
"default": {
"format": "[%(asctime)s,%(msecs)03d] %(levelname) 7s - \"-\" [%(filename)s:%(lineno)d %(funcName)s] | %(message)s",
"datefmt": "%d/%b/%Y %H:%M:%S"
},
"default_pywsgi_access_fix": {
"format": "%(message)s"
}
},
'handlers': {
'ui': {
'class': 'logging.FileHandler',
'formatter': 'default',
"filename": os.path.join(file_prefix, "{program_name!r}-ui.log".format(program_name=program_name))
},
'proxy': {
'class': 'logging.FileHandler',
'formatter': 'default',
"filename": os.path.join(file_prefix, "{program_name!r}-proxy.log".format(program_name=program_name))
},
'results': {
'class': 'logging.FileHandler',
'formatter': 'default_pywsgi_access_fix',
"filename": os.path.join(file_prefix, "{program_name!r}-results.log".format(program_name=program_name))
}
},
'loggers': {
'shadow.proxy': {
'level': 'INFO',
'propogate': 0,
'handlers': ['proxy']
},
'shadow.ui': {
'level': 'INFO',
'propogate': 0,
'handlers': ['ui']
},
'shadow.results': {
'level': 'INFO',
'propogate': 0,
'handlers': ['results']
},
'shadow': {
'level': 'INFO',
'propogate': 0,
'handlers': ['main']
}
}
}