##// END OF EJS Templates
formatters: added json formatter
ergo -
Show More
@@ -0,0 +1,69 b''
1 # -*- coding: utf-8 -*-
2
3 # Copyright (C) 2010-2016 RhodeCode GmbH
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17 # This program is dual-licensed. If you wish to learn more about the
18 # AppEnlight Enterprise Edition, including its added features, Support
19 # services, and proprietary license terms, please see
20 # https://rhodecode.com/licenses/
21
22 import json
23 import logging
24
25 ignored_keys = ['args', 'asctime', 'created', 'exc_info', 'exc_text',
26 'filename', 'funcName', 'levelname', 'levelno', 'lineno',
27 'message', 'module', 'msecs', 'msg', 'name', 'pathname',
28 'process', 'processName', 'relativeCreated', 'stack_info',
29 'thread', 'threadName']
30
31
32 class JSONFormatter(logging.Formatter):
33 def format(self, record):
34 """
35 Format the specified record as text.
36
37 The record's attribute dictionary is used as the operand to a
38 string formatting operation which yields the returned string.
39 Before formatting the dictionary, a couple of preparatory steps
40 are carried out. The message attribute of the record is computed
41 using LogRecord.getMessage(). If the formatting string uses the
42 time (as determined by a call to usesTime(), formatTime() is
43 called to format the event time. If there is exception information,
44 it is formatted using formatException() and appended to the message.
45 """
46 record.message = record.getMessage()
47 log_dict = vars(record)
48 keys = [k for k in log_dict.keys() if k not in ignored_keys]
49 payload = {'message': record.message}
50 payload.update({k: log_dict[k] for k in keys})
51 record.message = json.dumps(payload, default=lambda x: str(x))
52
53 if self.usesTime():
54 record.asctime = self.formatTime(record, self.datefmt)
55 s = self.formatMessage(record)
56 if record.exc_info:
57 # Cache the traceback text to avoid converting it multiple times
58 # (it's constant anyway)
59 if not record.exc_text:
60 record.exc_text = self.formatException(record.exc_info)
61 if record.exc_text:
62 if s[-1:] != "\n":
63 s = s + "\n"
64 s = s + record.exc_text
65 if record.stack_info:
66 if s[-1:] != "\n":
67 s = s + "\n"
68 s = s + self.formatStack(record.stack_info)
69 return s
@@ -1,184 +1,189 b''
1 [app:appenlight]
1 [app:appenlight]
2 use = egg:appenlight
2 use = egg:appenlight
3 reload_templates = false
3 reload_templates = false
4 debug_authorization = false
4 debug_authorization = false
5 debug_notfound = false
5 debug_notfound = false
6 debug_routematch = false
6 debug_routematch = false
7 debug_templates = false
7 debug_templates = false
8 default_locale_name = en
8 default_locale_name = en
9 sqlalchemy.url = {{ appenlight_dbstring }}
9 sqlalchemy.url = {{ appenlight_dbstring }}
10 sqlalchemy.pool_size = 10
10 sqlalchemy.pool_size = 10
11 sqlalchemy.max_overflow = 50
11 sqlalchemy.max_overflow = 50
12 sqlalchemy.echo = false
12 sqlalchemy.echo = false
13 jinja2.directories = appenlight:templates
13 jinja2.directories = appenlight:templates
14 jinja2.filters = nl2br = appenlight.lib.jinja2_filters.nl2br
14 jinja2.filters = nl2br = appenlight.lib.jinja2_filters.nl2br
15
15
16 #includes
16 #includes
17 appenlight.includes =
17 appenlight.includes =
18
18
19 #redis
19 #redis
20 redis.url = redis://localhost:6379/0
20 redis.url = redis://localhost:6379/0
21 redis.redlock.url = redis://localhost:6379/3
21 redis.redlock.url = redis://localhost:6379/3
22
22
23 #elasticsearch
23 #elasticsearch
24 elasticsearch.nodes = http://127.0.0.1:9200
24 elasticsearch.nodes = http://127.0.0.1:9200
25
25
26 #dirs
26 #dirs
27 webassets.dir = %(here)s/webassets/
27 webassets.dir = %(here)s/webassets/
28
28
29 # encryption
29 # encryption
30 encryption_secret = {{appenlight_encryption_secret}}
30 encryption_secret = {{appenlight_encryption_secret}}
31
31
32 #authtkt
32 #authtkt
33 # uncomment if you use SSL
33 # uncomment if you use SSL
34 # authtkt.secure = true
34 # authtkt.secure = true
35 authtkt.secret = {{appenlight_authtkt_secret}}
35 authtkt.secret = {{appenlight_authtkt_secret}}
36 # session settings
36 # session settings
37 redis.sessions.secret = {{appenlight_redis_session_secret}}
37 redis.sessions.secret = {{appenlight_redis_session_secret}}
38 redis.sessions.timeout = 86400
38 redis.sessions.timeout = 86400
39
39
40 # session cookie settings
40 # session cookie settings
41 redis.sessions.cookie_name = appenlight
41 redis.sessions.cookie_name = appenlight
42 redis.sessions.cookie_max_age = 2592000
42 redis.sessions.cookie_max_age = 2592000
43 redis.sessions.cookie_path = /
43 redis.sessions.cookie_path = /
44 redis.sessions.cookie_domain =
44 redis.sessions.cookie_domain =
45 # uncomment if you use SSL
45 # uncomment if you use SSL
46 redis.sessions.cookie_secure = True
46 redis.sessions.cookie_secure = True
47 redis.sessions.cookie_httponly = True
47 redis.sessions.cookie_httponly = True
48 redis.sessions.cookie_on_exception = True
48 redis.sessions.cookie_on_exception = True
49 redis.sessions.prefix = appenlight:session:
49 redis.sessions.prefix = appenlight:session:
50
50
51 #cache
51 #cache
52 cache.regions = default_term, second, short_term, long_term
52 cache.regions = default_term, second, short_term, long_term
53 cache.type = ext:memcached
53 cache.type = ext:memcached
54 cache.url = 127.0.0.1:11211
54 cache.url = 127.0.0.1:11211
55 cache.lock_dir = %(here)s/data/cache/lock
55 cache.lock_dir = %(here)s/data/cache/lock
56 cache.second.expire = 1
56 cache.second.expire = 1
57 cache.short_term.expire = 60
57 cache.short_term.expire = 60
58 cache.default_term.expire = 300
58 cache.default_term.expire = 300
59
59
60 #mailing
60 #mailing
61 mailing.app_url = https://{{appenlight_domain}}
61 mailing.app_url = https://{{appenlight_domain}}
62 mailing.from_name = AppEnlight
62 mailing.from_name = AppEnlight
63 mailing.from_email = no-reply@{{appenlight_domain}}
63 mailing.from_email = no-reply@{{appenlight_domain}}
64
64
65 ###
65 ###
66 # Authomatic configuration
66 # Authomatic configuration
67 ###
67 ###
68
68
69 authomatic.secret =
69 authomatic.secret =
70 authomatic.pr.facebook.app_id =
70 authomatic.pr.facebook.app_id =
71 authomatic.pr.facebook.secret =
71 authomatic.pr.facebook.secret =
72 authomatic.pr.twitter.key =
72 authomatic.pr.twitter.key =
73 authomatic.pr.twitter.secret =
73 authomatic.pr.twitter.secret =
74 authomatic.pr.google.key =
74 authomatic.pr.google.key =
75 authomatic.pr.google.secret =
75 authomatic.pr.google.secret =
76 authomatic.pr.github.key =
76 authomatic.pr.github.key =
77 authomatic.pr.github.secret =
77 authomatic.pr.github.secret =
78 authomatic.pr.github.scope =
78 authomatic.pr.github.scope =
79 authomatic.pr.bitbucket.key =
79 authomatic.pr.bitbucket.key =
80 authomatic.pr.bitbucket.secret =
80 authomatic.pr.bitbucket.secret =
81
81
82 #ziggurat
82 #ziggurat
83 ziggurat_foundations.model_locations.User = appenlight.models.user:User
83 ziggurat_foundations.model_locations.User = appenlight.models.user:User
84 ziggurat_foundations.sign_in.username_key = sign_in_user_name
84 ziggurat_foundations.sign_in.username_key = sign_in_user_name
85 ziggurat_foundations.sign_in.password_key = sign_in_user_password
85 ziggurat_foundations.sign_in.password_key = sign_in_user_password
86 ziggurat_foundations.sign_in.came_from_key = came_from
86 ziggurat_foundations.sign_in.came_from_key = came_from
87
87
88 #cometd
88 #cometd
89 cometd.server = http://127.0.0.1:8088
89 cometd.server = http://127.0.0.1:8088
90 cometd.secret = secret
90 cometd.secret = secret
91 cometd.ws_url = wss://{{appenlight_domain}}/channelstream
91 cometd.ws_url = wss://{{appenlight_domain}}/channelstream
92
92
93 # for celery
93 # for celery
94 appenlight.api_key =
94 appenlight.api_key =
95 appenlight.transport_config =
95 appenlight.transport_config =
96 appenlight.public_api_key =
96 appenlight.public_api_key =
97
97
98 # celery
98 # celery
99 celery.broker_type = redis
99 celery.broker_type = redis
100 celery.broker_url = redis://localhost:6379/3
100 celery.broker_url = redis://localhost:6379/3
101 celery.concurrency = 2
101 celery.concurrency = 2
102 celery.timezone = UTC
102 celery.timezone = UTC
103
103
104 # tasks
104 # tasks
105
105
106 # how often run alerting tasks (60s default)
106 # how often run alerting tasks (60s default)
107 tasks.notifications_reports.interval = 60
107 tasks.notifications_reports.interval = 60
108
108
109 [filter:paste_prefix]
109 [filter:paste_prefix]
110 use = egg:PasteDeploy#prefix
110 use = egg:PasteDeploy#prefix
111
111
112
112
113 [filter:appenlight_client]
113 [filter:appenlight_client]
114 use = egg:appenlight_client
114 use = egg:appenlight_client
115 appenlight.api_key =
115 appenlight.api_key =
116
116
117 # appenlight.transport_config = http://127.0.0.1:6543?threaded=1&timeout=5&verify=0
117 # appenlight.transport_config = http://127.0.0.1:6543?threaded=1&timeout=5&verify=0
118 # by default uses api.appenlight.com server
118 # by default uses api.appenlight.com server
119 appenlight.transport_config =
119 appenlight.transport_config =
120 appenlight.report_local_vars = true
120 appenlight.report_local_vars = true
121 appenlight.report_404 = true
121 appenlight.report_404 = true
122 appenlight.timing.dbapi2_psycopg2 = 0.3
122 appenlight.timing.dbapi2_psycopg2 = 0.3
123
123
124
124
125
125
126 [pipeline:main]
126 [pipeline:main]
127 pipeline = paste_prefix
127 pipeline = paste_prefix
128 appenlight_client
128 appenlight_client
129 appenlight
129 appenlight
130
130
131
131
132
132
133 [server:main]
133 [server:main]
134 use = egg:gunicorn#main
134 use = egg:gunicorn#main
135 host = 0.0.0.0:6543, unix:/tmp/appenlight.sock
135 host = 0.0.0.0:6543, unix:/tmp/appenlight.sock
136 workers = 2
136 workers = 2
137 timeout = 90
137 timeout = 90
138 max_requests = 10000
138 max_requests = 10000
139
139
140 [server:api]
140 [server:api]
141 use = egg:gunicorn#main
141 use = egg:gunicorn#main
142 host = 0.0.0.0:6553, unix:/tmp/api.appenlight.sock
142 host = 0.0.0.0:6553, unix:/tmp/api.appenlight.sock
143 workers = 2
143 workers = 2
144 max_requests = 10000
144 max_requests = 10000
145
145
146
146
147 # Begin logging configuration
147 # Begin logging configuration
148
148
149 [loggers]
149 [loggers]
150 keys = root, appenlight, sqlalchemy
150 keys = root, appenlight, sqlalchemy
151
151
152 [handlers]
152 [handlers]
153 keys = console
153 keys = console
154
154
155 [formatters]
155 [formatters]
156 keys = generic
156 keys = generic, json
157
157
158 [logger_root]
158 [logger_root]
159 level = WARN
159 level = WARN
160 handlers = console
160 handlers = console
161
161
162 [logger_appenlight]
162 [logger_appenlight]
163 level = WARN
163 level = WARN
164 handlers =
164 handlers =
165 qualname = appenlight
165 qualname = appenlight
166
166
167 [logger_sqlalchemy]
167 [logger_sqlalchemy]
168 level = WARN
168 level = WARN
169 handlers =
169 handlers =
170 qualname = sqlalchemy.engine
170 qualname = sqlalchemy.engine
171 # "level = INFO" logs SQL queries.
171 # "level = INFO" logs SQL queries.
172 # "level = DEBUG" logs SQL queries and results.
172 # "level = DEBUG" logs SQL queries and results.
173 # "level = WARN" logs neither. (Recommended for production systems.)
173 # "level = WARN" logs neither. (Recommended for production systems.)
174
174
175 [handler_console]
175 [handler_console]
176 class = StreamHandler
176 class = StreamHandler
177 args = (sys.stderr,)
177 args = (sys.stderr,)
178 level = NOTSET
178 level = NOTSET
179 formatter = generic
179 formatter = json
180
180
181 [formatter_generic]
181 [formatter_generic]
182 format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
182 format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
183
183
184 # json string will land as "message" key of format string
185 [formatter_json]
186 class=appenlight.lib.logging.JSONFormatter
187 format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s
188
184 # End logging configuration
189 # End logging configuration
@@ -1,196 +1,201 b''
1 [app:appenlight]
1 [app:appenlight]
2 use = egg:appenlight
2 use = egg:appenlight
3 reload_templates = true
3 reload_templates = true
4 debug_authorization = true
4 debug_authorization = true
5 debug_notfound = true
5 debug_notfound = true
6 debug_routematch = true
6 debug_routematch = true
7 debug_templates = true
7 debug_templates = true
8 default_locale_name = en
8 default_locale_name = en
9 sqlalchemy.url = postgresql://test:test@localhost/appenlight
9 sqlalchemy.url = postgresql://test:test@localhost/appenlight
10 sqlalchemy.pool_size = 10
10 sqlalchemy.pool_size = 10
11 sqlalchemy.max_overflow = 50
11 sqlalchemy.max_overflow = 50
12 sqlalchemy.echo = false
12 sqlalchemy.echo = false
13 jinja2.directories = appenlight:templates
13 jinja2.directories = appenlight:templates
14 jinja2.filters = nl2br = appenlight.lib.jinja2_filters.nl2br
14 jinja2.filters = nl2br = appenlight.lib.jinja2_filters.nl2br
15
15
16
16
17 pyramid.includes = pyramid_debugtoolbar
17 pyramid.includes = pyramid_debugtoolbar
18
18
19 debugtoolbar.panels =
19 debugtoolbar.panels =
20 pyramid_debugtoolbar.panels.versions.VersionDebugPanel
20 pyramid_debugtoolbar.panels.versions.VersionDebugPanel
21 pyramid_debugtoolbar.panels.settings.SettingsDebugPanel
21 pyramid_debugtoolbar.panels.settings.SettingsDebugPanel
22 pyramid_debugtoolbar.panels.headers.HeaderDebugPanel
22 pyramid_debugtoolbar.panels.headers.HeaderDebugPanel
23 pyramid_debugtoolbar.panels.renderings.RenderingsDebugPanel
23 pyramid_debugtoolbar.panels.renderings.RenderingsDebugPanel
24 pyramid_debugtoolbar.panels.logger.LoggingPanel
24 pyramid_debugtoolbar.panels.logger.LoggingPanel
25 pyramid_debugtoolbar.panels.performance.PerformanceDebugPanel
25 pyramid_debugtoolbar.panels.performance.PerformanceDebugPanel
26 pyramid_debugtoolbar.panels.routes.RoutesDebugPanel
26 pyramid_debugtoolbar.panels.routes.RoutesDebugPanel
27 pyramid_debugtoolbar.panels.sqla.SQLADebugPanel
27 pyramid_debugtoolbar.panels.sqla.SQLADebugPanel
28 pyramid_debugtoolbar.panels.tweens.TweensDebugPanel
28 pyramid_debugtoolbar.panels.tweens.TweensDebugPanel
29 pyramid_debugtoolbar.panels.introspection.IntrospectionDebugPanel
29 pyramid_debugtoolbar.panels.introspection.IntrospectionDebugPanel
30
30
31 appenlight.includes =
31 appenlight.includes =
32
32
33 # encryption
33 # encryption
34 encryption_secret = oEOikr_T98wTh_xLH3w8Se3kmbgAQYSM4poZvPosya0=
34 encryption_secret = oEOikr_T98wTh_xLH3w8Se3kmbgAQYSM4poZvPosya0=
35
35
36 #redis
36 #redis
37 redis.url = redis://localhost:6379/0
37 redis.url = redis://localhost:6379/0
38 redis.redlock.url = redis://localhost:6379/3
38 redis.redlock.url = redis://localhost:6379/3
39
39
40 #elasticsearch
40 #elasticsearch
41 elasticsearch.nodes = http://127.0.0.1:9200
41 elasticsearch.nodes = http://127.0.0.1:9200
42
42
43 #dirs
43 #dirs
44 webassets.dir = %(here)s/webassets/
44 webassets.dir = %(here)s/webassets/
45
45
46 #authtkt
46 #authtkt
47 authtkt.secure = false
47 authtkt.secure = false
48 authtkt.secret = SECRET
48 authtkt.secret = SECRET
49 # session settings
49 # session settings
50 redis.sessions.secret = SECRET
50 redis.sessions.secret = SECRET
51 redis.sessions.timeout = 86400
51 redis.sessions.timeout = 86400
52
52
53 # session cookie settings
53 # session cookie settings
54 redis.sessions.cookie_name = appenlight
54 redis.sessions.cookie_name = appenlight
55 redis.sessions.cookie_max_age = 2592000
55 redis.sessions.cookie_max_age = 2592000
56 redis.sessions.cookie_path = /
56 redis.sessions.cookie_path = /
57 redis.sessions.cookie_domain =
57 redis.sessions.cookie_domain =
58 redis.sessions.cookie_secure = False
58 redis.sessions.cookie_secure = False
59 redis.sessions.cookie_httponly = False
59 redis.sessions.cookie_httponly = False
60 redis.sessions.cookie_on_exception = True
60 redis.sessions.cookie_on_exception = True
61 redis.sessions.prefix = appenlight:session:
61 redis.sessions.prefix = appenlight:session:
62
62
63
63
64 #cache
64 #cache
65 cache.regions = default_term, second, short_term, long_term
65 cache.regions = default_term, second, short_term, long_term
66 cache.type = ext:memcached
66 cache.type = ext:memcached
67 cache.url = 127.0.0.1:11211
67 cache.url = 127.0.0.1:11211
68 cache.lock_dir = %(here)s/data/cache/lock
68 cache.lock_dir = %(here)s/data/cache/lock
69 cache.second.expire = 1
69 cache.second.expire = 1
70 cache.short_term.expire = 60
70 cache.short_term.expire = 60
71 cache.default_term.expire = 300
71 cache.default_term.expire = 300
72
72
73 #mailing
73 #mailing
74 mailing.app_url = http://localhost:6543
74 mailing.app_url = http://localhost:6543
75 mailing.from_name = App Enlight LOCAL
75 mailing.from_name = App Enlight LOCAL
76 mailing.from_email = no-reply@appenlight.local
76 mailing.from_email = no-reply@appenlight.local
77
77
78
78
79 ###
79 ###
80 # Authomatic configuration
80 # Authomatic configuration
81 ###
81 ###
82
82
83 authomatic.secret = SECRET
83 authomatic.secret = SECRET
84 authomatic.pr.facebook.app_id =
84 authomatic.pr.facebook.app_id =
85 authomatic.pr.facebook.secret =
85 authomatic.pr.facebook.secret =
86 authomatic.pr.twitter.key =
86 authomatic.pr.twitter.key =
87 authomatic.pr.twitter.secret =
87 authomatic.pr.twitter.secret =
88 authomatic.pr.google.key =
88 authomatic.pr.google.key =
89 authomatic.pr.google.secret =
89 authomatic.pr.google.secret =
90 authomatic.pr.github.key =
90 authomatic.pr.github.key =
91 authomatic.pr.github.secret =
91 authomatic.pr.github.secret =
92 authomatic.pr.github.scope = repo, public_repo, user:email
92 authomatic.pr.github.scope = repo, public_repo, user:email
93 authomatic.pr.bitbucket.key =
93 authomatic.pr.bitbucket.key =
94 authomatic.pr.bitbucket.secret =
94 authomatic.pr.bitbucket.secret =
95
95
96 #ziggurat
96 #ziggurat
97 ziggurat_foundations.model_locations.User = appenlight.models.user:User
97 ziggurat_foundations.model_locations.User = appenlight.models.user:User
98 ziggurat_foundations.sign_in.username_key = sign_in_user_name
98 ziggurat_foundations.sign_in.username_key = sign_in_user_name
99 ziggurat_foundations.sign_in.password_key = sign_in_user_password
99 ziggurat_foundations.sign_in.password_key = sign_in_user_password
100 ziggurat_foundations.sign_in.came_from_key = came_from
100 ziggurat_foundations.sign_in.came_from_key = came_from
101
101
102 #cometd
102 #cometd
103 cometd.server = http://127.0.0.1:8088/
103 cometd.server = http://127.0.0.1:8088/
104 cometd.secret = secret
104 cometd.secret = secret
105 cometd.ws_url = http://127.0.0.1:8088/
105 cometd.ws_url = http://127.0.0.1:8088/
106
106
107
107
108 # for celery
108 # for celery
109 appenlight.api_key =
109 appenlight.api_key =
110 appenlight.transport_config =
110 appenlight.transport_config =
111 appenlight.public_api_key =
111 appenlight.public_api_key =
112
112
113 celery.broker_type = redis
113 celery.broker_type = redis
114 celery.broker_url = redis://localhost:6379/3
114 celery.broker_url = redis://localhost:6379/3
115 celery.concurrency = 4
115 celery.concurrency = 4
116 celery.timezone = UTC
116 celery.timezone = UTC
117
117
118
118
119 [filter:paste_prefix]
119 [filter:paste_prefix]
120 use = egg:PasteDeploy#prefix
120 use = egg:PasteDeploy#prefix
121
121
122
122
123 [filter:appenlight_client]
123 [filter:appenlight_client]
124 use = egg:appenlight_client
124 use = egg:appenlight_client
125 appenlight.api_key =
125 appenlight.api_key =
126 appenlight.transport_config =
126 appenlight.transport_config =
127 appenlight.report_local_vars = true
127 appenlight.report_local_vars = true
128 appenlight.report_404 = true
128 appenlight.report_404 = true
129 appenlight.logging.level = DEBUG
129 appenlight.logging.level = DEBUG
130 appenlight.timing.dbapi2_psycopg2 = 0.3
130 appenlight.timing.dbapi2_psycopg2 = 0.3
131
131
132
132
133 [pipeline:main]
133 [pipeline:main]
134 pipeline =
134 pipeline =
135 paste_prefix
135 paste_prefix
136 appenlight_client
136 appenlight_client
137 appenlight
137 appenlight
138
138
139
139
140
140
141 [server:main]
141 [server:main]
142 use = egg:waitress
142 use = egg:waitress
143 host = 0.0.0.0
143 host = 0.0.0.0
144 port = 6543
144 port = 6543
145
145
146 [server:main_prod]
146 [server:main_prod]
147 use = egg:gunicorn#main
147 use = egg:gunicorn#main
148 host = 0.0.0.0:6543, unix:/tmp/appenlight.sock
148 host = 0.0.0.0:6543, unix:/tmp/appenlight.sock
149 workers = 6
149 workers = 6
150 timeout = 90
150 timeout = 90
151 #max_requests = 1000
151 #max_requests = 1000
152
152
153
153
154 # Begin logging configuration
154 # Begin logging configuration
155
155
156 [loggers]
156 [loggers]
157 keys = root, appenlight, sqlalchemy, elasticsearch
157 keys = root, appenlight, sqlalchemy, elasticsearch
158
158
159 [handlers]
159 [handlers]
160 keys = console
160 keys = console
161
161
162 [formatters]
162 [formatters]
163 keys = generic
163 keys = generic, json
164
164
165 [logger_root]
165 [logger_root]
166 level = INFO
166 level = INFO
167 handlers = console
167 handlers = console
168
168
169 [logger_appenlight]
169 [logger_appenlight]
170 level = INFO
170 level = INFO
171 handlers =
171 handlers =
172 qualname = appenlight
172 qualname = appenlight
173
173
174 [logger_elasticsearch]
174 [logger_elasticsearch]
175 level = WARN
175 level = WARN
176 handlers =
176 handlers =
177 qualname = elasticsearch
177 qualname = elasticsearch
178
178
179 [logger_sqlalchemy]
179 [logger_sqlalchemy]
180 level = WARN
180 level = WARN
181 handlers =
181 handlers =
182 qualname = sqlalchemy.engine
182 qualname = sqlalchemy.engine
183 # "level = INFO" logs SQL queries.
183 # "level = INFO" logs SQL queries.
184 # "level = DEBUG" logs SQL queries and results.
184 # "level = DEBUG" logs SQL queries and results.
185 # "level = WARN" logs neither. (Recommended for production systems.)
185 # "level = WARN" logs neither. (Recommended for production systems.)
186
186
187 [handler_console]
187 [handler_console]
188 class = StreamHandler
188 class = StreamHandler
189 args = (sys.stderr,)
189 args = (sys.stderr,)
190 level = NOTSET
190 level = NOTSET
191 formatter = generic
191 formatter = json
192
192
193 [formatter_generic]
193 [formatter_generic]
194 format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
194 format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
195
195
196 # json string will land as "message" key of format string
197 [formatter_json]
198 class=appenlight.lib.logging.JSONFormatter
199 format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s
200
196 # End logging configuration
201 # End logging configuration
@@ -1,182 +1,187 b''
1 [app:appenlight]
1 [app:appenlight]
2 use = egg:appenlight
2 use = egg:appenlight
3 reload_templates = true
3 reload_templates = true
4 debug_authorization = true
4 debug_authorization = true
5 debug_notfound = true
5 debug_notfound = true
6 debug_routematch = true
6 debug_routematch = true
7 debug_templates = true
7 debug_templates = true
8 default_locale_name = en
8 default_locale_name = en
9 sqlalchemy.url = postgresql://test:test@localhost/appenlight_test
9 sqlalchemy.url = postgresql://test:test@localhost/appenlight_test
10 sqlalchemy.pool_size = 2
10 sqlalchemy.pool_size = 2
11 sqlalchemy.max_overflow = 5
11 sqlalchemy.max_overflow = 5
12 sqlalchemy.echo = false
12 sqlalchemy.echo = false
13 jinja2.directories = appenlight:templates
13 jinja2.directories = appenlight:templates
14 jinja2.filters = nl2br = appenlight.lib.jinja2_filters.nl2br
14 jinja2.filters = nl2br = appenlight.lib.jinja2_filters.nl2br
15
15
16
16
17 pyramid.includes = pyramid_debugtoolbar
17 pyramid.includes = pyramid_debugtoolbar
18
18
19 appenlight.includes =
19 appenlight.includes =
20
20
21 # encryption
21 # encryption
22 encryption_secret = oEOikr_T98wTh_xLH3w8Se3kmbgAQYSM4poZvPosya0=
22 encryption_secret = oEOikr_T98wTh_xLH3w8Se3kmbgAQYSM4poZvPosya0=
23
23
24 #redis
24 #redis
25 redis.url = redis://localhost:6379/0
25 redis.url = redis://localhost:6379/0
26 redis.redlock.url = redis://localhost:6379/3
26 redis.redlock.url = redis://localhost:6379/3
27
27
28 #elasticsearch
28 #elasticsearch
29 elasticsearch.nodes = http://127.0.0.1:9200
29 elasticsearch.nodes = http://127.0.0.1:9200
30
30
31 #dirs
31 #dirs
32 webassets.dir = %(here)s/webassets/
32 webassets.dir = %(here)s/webassets/
33
33
34 #authtkt
34 #authtkt
35 authtkt.secure = false
35 authtkt.secure = false
36 authtkt.secret = SECRET
36 authtkt.secret = SECRET
37 # session settings
37 # session settings
38 redis.sessions.secret = SECRET
38 redis.sessions.secret = SECRET
39 redis.sessions.timeout = 3600
39 redis.sessions.timeout = 3600
40
40
41 # session cookie settings
41 # session cookie settings
42 redis.sessions.cookie_name = appenlight
42 redis.sessions.cookie_name = appenlight
43 redis.sessions.cookie_max_age = 2592000
43 redis.sessions.cookie_max_age = 2592000
44 redis.sessions.cookie_path = /
44 redis.sessions.cookie_path = /
45 redis.sessions.cookie_domain =
45 redis.sessions.cookie_domain =
46 redis.sessions.cookie_secure = False
46 redis.sessions.cookie_secure = False
47 redis.sessions.cookie_httponly = False
47 redis.sessions.cookie_httponly = False
48 redis.sessions.cookie_on_exception = True
48 redis.sessions.cookie_on_exception = True
49 redis.sessions.prefix = appenlight:session:
49 redis.sessions.prefix = appenlight:session:
50
50
51
51
52 #cache
52 #cache
53 cache.regions = default_term, second, short_term, long_term
53 cache.regions = default_term, second, short_term, long_term
54 cache.type = ext:memcached
54 cache.type = ext:memcached
55 cache.url = 127.0.0.1:11211
55 cache.url = 127.0.0.1:11211
56 cache.lock_dir = %(here)s/data/cache/lock
56 cache.lock_dir = %(here)s/data/cache/lock
57 cache.second.expire = 1
57 cache.second.expire = 1
58 cache.short_term.expire = 60
58 cache.short_term.expire = 60
59 cache.default_term.expire = 300
59 cache.default_term.expire = 300
60
60
61 #mailing
61 #mailing
62 mailing.app_url = https://appenlight.com
62 mailing.app_url = https://appenlight.com
63 mailing.from_name = App Enlight LOCAL
63 mailing.from_name = App Enlight LOCAL
64 mailing.from_email = no-reply@status.appenlight.com
64 mailing.from_email = no-reply@status.appenlight.com
65
65
66
66
67 ###
67 ###
68 # Authomatic configuration
68 # Authomatic configuration
69 ###
69 ###
70
70
71 authomatic.secret = secret
71 authomatic.secret = secret
72 authomatic.pr.facebook.app_id =
72 authomatic.pr.facebook.app_id =
73 authomatic.pr.facebook.secret =
73 authomatic.pr.facebook.secret =
74 authomatic.pr.twitter.key =
74 authomatic.pr.twitter.key =
75 authomatic.pr.twitter.secret =
75 authomatic.pr.twitter.secret =
76 authomatic.pr.google.key =
76 authomatic.pr.google.key =
77 authomatic.pr.google.secret =
77 authomatic.pr.google.secret =
78 authomatic.pr.github.key =
78 authomatic.pr.github.key =
79 authomatic.pr.github.secret =
79 authomatic.pr.github.secret =
80 authomatic.pr.github.scope = repo, public_repo, user:email
80 authomatic.pr.github.scope = repo, public_repo, user:email
81 authomatic.pr.bitbucket.key =
81 authomatic.pr.bitbucket.key =
82 authomatic.pr.bitbucket.secret =
82 authomatic.pr.bitbucket.secret =
83
83
84 #ziggurat
84 #ziggurat
85 ziggurat_foundations.model_locations.User = appenlight.models.user:User
85 ziggurat_foundations.model_locations.User = appenlight.models.user:User
86 ziggurat_foundations.sign_in.username_key = sign_in_user_name
86 ziggurat_foundations.sign_in.username_key = sign_in_user_name
87 ziggurat_foundations.sign_in.password_key = sign_in_user_password
87 ziggurat_foundations.sign_in.password_key = sign_in_user_password
88 ziggurat_foundations.sign_in.came_from_key = came_from
88 ziggurat_foundations.sign_in.came_from_key = came_from
89
89
90 #cometd
90 #cometd
91 cometd.server = http://127.0.0.1:8088/
91 cometd.server = http://127.0.0.1:8088/
92 cometd.secret = secret
92 cometd.secret = secret
93 cometd.ws_url = wss://127.0.0.1:8088/
93 cometd.ws_url = wss://127.0.0.1:8088/
94
94
95
95
96 # for celery
96 # for celery
97 appenlight.api_key =
97 appenlight.api_key =
98 appenlight.transport_config = http://127.0.0.1:6543
98 appenlight.transport_config = http://127.0.0.1:6543
99
99
100 celery.broker_type = redis
100 celery.broker_type = redis
101 celery.broker_url = redis://localhost:6379/4
101 celery.broker_url = redis://localhost:6379/4
102 celery.concurrency = 4
102 celery.concurrency = 4
103 celery.timezone = UTC
103 celery.timezone = UTC
104 celery.always_eager = true
104 celery.always_eager = true
105
105
106 [filter:paste_prefix]
106 [filter:paste_prefix]
107 use = egg:PasteDeploy#prefix
107 use = egg:PasteDeploy#prefix
108
108
109
109
110 [filter:appenlight_client]
110 [filter:appenlight_client]
111 use = egg:appenlight_client
111 use = egg:appenlight_client
112 appenlight.api_key =
112 appenlight.api_key =
113 appenlight.transport_config = http://127.0.0.1:6543
113 appenlight.transport_config = http://127.0.0.1:6543
114 appenlight.report_local_vars = true
114 appenlight.report_local_vars = true
115 appenlight.report_404 = true
115 appenlight.report_404 = true
116 appenlight.timing.dbapi2_psycopg2 = 0.3
116 appenlight.timing.dbapi2_psycopg2 = 0.3
117
117
118
118
119 [pipeline:main]
119 [pipeline:main]
120 pipeline =
120 pipeline =
121 paste_prefix
121 paste_prefix
122 appenlight_client
122 appenlight_client
123 appenlight
123 appenlight
124
124
125
125
126
126
127 [server:main]
127 [server:main]
128 use = egg:waitress
128 use = egg:waitress
129 host = 0.0.0.0
129 host = 0.0.0.0
130 port = 6543
130 port = 6543
131
131
132 [server:main_prod]
132 [server:main_prod]
133 use = egg:gunicorn#main
133 use = egg:gunicorn#main
134 host = 0.0.0.0:6543, unix:/tmp/appenlight.sock
134 host = 0.0.0.0:6543, unix:/tmp/appenlight.sock
135 workers = 6
135 workers = 6
136 timeout = 90
136 timeout = 90
137 #max_requests = 1000
137 #max_requests = 1000
138
138
139
139
140 # Begin logging configuration
140 # Begin logging configuration
141
141
142 [loggers]
142 [loggers]
143 keys = root, appenlight, sqlalchemy, elasticsearch
143 keys = root, appenlight, sqlalchemy, elasticsearch
144
144
145 [handlers]
145 [handlers]
146 keys = console
146 keys = console
147
147
148 [formatters]
148 [formatters]
149 keys = generic
149 keys = generic, json
150
150
151 [logger_root]
151 [logger_root]
152 level = INFO
152 level = INFO
153 handlers = console
153 handlers = console
154
154
155 [logger_appenlight]
155 [logger_appenlight]
156 level = INFO
156 level = INFO
157 handlers =
157 handlers =
158 qualname = appenlight
158 qualname = appenlight
159
159
160 [logger_elasticsearch]
160 [logger_elasticsearch]
161 level = WARN
161 level = WARN
162 handlers =
162 handlers =
163 qualname = elasticsearch
163 qualname = elasticsearch
164
164
165 [logger_sqlalchemy]
165 [logger_sqlalchemy]
166 level = WARN
166 level = WARN
167 handlers =
167 handlers =
168 qualname = sqlalchemy.engine
168 qualname = sqlalchemy.engine
169 # "level = INFO" logs SQL queries.
169 # "level = INFO" logs SQL queries.
170 # "level = DEBUG" logs SQL queries and results.
170 # "level = DEBUG" logs SQL queries and results.
171 # "level = WARN" logs neither. (Recommended for production systems.)
171 # "level = WARN" logs neither. (Recommended for production systems.)
172
172
173 [handler_console]
173 [handler_console]
174 class = StreamHandler
174 class = StreamHandler
175 args = (sys.stderr,)
175 args = (sys.stderr,)
176 level = NOTSET
176 level = NOTSET
177 formatter = generic
177 formatter = json
178
178
179 [formatter_generic]
179 [formatter_generic]
180 format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
180 format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
181
181
182 # json string will land as "message" key of format string
183 [formatter_json]
184 class=appenlight.lib.logging.JSONFormatter
185 format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)s
186
182 # End logging configuration
187 # End logging configuration
General Comments 0
You need to be logged in to leave comments. Login now