##// END OF EJS Templates
timperproxy will just measure the time of queries, and formatting will be handled by the new sql_formatter of queries from sqlalchemy itself. Updated ini files for new way logging
marcink -
r1186:b9ea10d3 beta
parent child Browse files
Show More
@@ -1,221 +1,232 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
9 debug = true
9 debug = true
10 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25 #smtp_use_ssl = true
25 #smtp_use_ssl = true
26
26
27 [server:main]
27 [server:main]
28 ##nr of threads to spawn
28 ##nr of threads to spawn
29 threadpool_workers = 5
29 threadpool_workers = 5
30
30
31 ##max request before thread respawn
31 ##max request before thread respawn
32 threadpool_max_requests = 6
32 threadpool_max_requests = 6
33
33
34 ##option to use threads of process
34 ##option to use threads of process
35 use_threadpool = true
35 use_threadpool = true
36
36
37 use = egg:Paste#http
37 use = egg:Paste#http
38 host = 0.0.0.0
38 host = 0.0.0.0
39 port = 5000
39 port = 5000
40
40
41 [app:main]
41 [app:main]
42 use = egg:rhodecode
42 use = egg:rhodecode
43 full_stack = true
43 full_stack = true
44 static_files = true
44 static_files = true
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 app_instance_uuid = develop
48 app_instance_uuid = develop
49 cut_off_limit = 256000
49 cut_off_limit = 256000
50 force_https = false
50 force_https = false
51 commit_parse_limit = 25
51 commit_parse_limit = 25
52 use_gravatar = true
52 use_gravatar = true
53
53
54 ####################################
54 ####################################
55 ### CELERY CONFIG ####
55 ### CELERY CONFIG ####
56 ####################################
56 ####################################
57 use_celery = false
57 use_celery = false
58 broker.host = localhost
58 broker.host = localhost
59 broker.vhost = rabbitmqhost
59 broker.vhost = rabbitmqhost
60 broker.port = 5672
60 broker.port = 5672
61 broker.user = rabbitmq
61 broker.user = rabbitmq
62 broker.password = qweqwe
62 broker.password = qweqwe
63
63
64 celery.imports = rhodecode.lib.celerylib.tasks
64 celery.imports = rhodecode.lib.celerylib.tasks
65
65
66 celery.result.backend = amqp
66 celery.result.backend = amqp
67 celery.result.dburi = amqp://
67 celery.result.dburi = amqp://
68 celery.result.serialier = json
68 celery.result.serialier = json
69
69
70 #celery.send.task.error.emails = true
70 #celery.send.task.error.emails = true
71 #celery.amqp.task.result.expires = 18000
71 #celery.amqp.task.result.expires = 18000
72
72
73 celeryd.concurrency = 2
73 celeryd.concurrency = 2
74 #celeryd.log.file = celeryd.log
74 #celeryd.log.file = celeryd.log
75 celeryd.log.level = debug
75 celeryd.log.level = debug
76 celeryd.max.tasks.per.child = 1
76 celeryd.max.tasks.per.child = 1
77
77
78 #tasks will never be sent to the queue, but executed locally instead.
78 #tasks will never be sent to the queue, but executed locally instead.
79 celery.always.eager = false
79 celery.always.eager = false
80
80
81 ####################################
81 ####################################
82 ### BEAKER CACHE ####
82 ### BEAKER CACHE ####
83 ####################################
83 ####################################
84 beaker.cache.data_dir=%(here)s/data/cache/data
84 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
86
86
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88
88
89 beaker.cache.super_short_term.type=memory
89 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.expire=10
90 beaker.cache.super_short_term.expire=10
91
91
92 beaker.cache.short_term.type=memory
92 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.expire=60
93 beaker.cache.short_term.expire=60
94
94
95 beaker.cache.long_term.type=memory
95 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.expire=36000
96 beaker.cache.long_term.expire=36000
97
97
98 beaker.cache.sql_cache_short.type=memory
98 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.expire=10
99 beaker.cache.sql_cache_short.expire=10
100
100
101 beaker.cache.sql_cache_med.type=memory
101 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.expire=360
102 beaker.cache.sql_cache_med.expire=360
103
103
104 beaker.cache.sql_cache_long.type=file
104 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.expire=3600
105 beaker.cache.sql_cache_long.expire=3600
106
106
107 ####################################
107 ####################################
108 ### BEAKER SESSION ####
108 ### BEAKER SESSION ####
109 ####################################
109 ####################################
110 ## Type of storage used for the session, current types are
110 ## Type of storage used for the session, current types are
111 ## dbm, file, memcached, database, and memory.
111 ## dbm, file, memcached, database, and memory.
112 ## The storage uses the Container API
112 ## The storage uses the Container API
113 ##that is also used by the cache system.
113 ##that is also used by the cache system.
114 beaker.session.type = file
114 beaker.session.type = file
115
115
116 beaker.session.key = rhodecode
116 beaker.session.key = rhodecode
117 beaker.session.secret = g654dcno0-9873jhgfreyu
117 beaker.session.secret = g654dcno0-9873jhgfreyu
118 beaker.session.timeout = 36000
118 beaker.session.timeout = 36000
119
119
120 ##auto save the session to not to use .save()
120 ##auto save the session to not to use .save()
121 beaker.session.auto = False
121 beaker.session.auto = False
122
122
123 ##true exire at browser close
123 ##true exire at browser close
124 #beaker.session.cookie_expires = 3600
124 #beaker.session.cookie_expires = 3600
125
125
126
126
127 ################################################################################
127 ################################################################################
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## execute malicious code after an exception is raised. ##
130 ## execute malicious code after an exception is raised. ##
131 ################################################################################
131 ################################################################################
132 #set debug = false
132 #set debug = false
133
133
134 ##################################
134 ##################################
135 ### LOGVIEW CONFIG ###
135 ### LOGVIEW CONFIG ###
136 ##################################
136 ##################################
137 logview.sqlalchemy = #faa
137 logview.sqlalchemy = #faa
138 logview.pylons.templating = #bfb
138 logview.pylons.templating = #bfb
139 logview.pylons.util = #eee
139 logview.pylons.util = #eee
140
140
141 #########################################################
141 #########################################################
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 #########################################################
143 #########################################################
144 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
144 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
145 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
146 #sqlalchemy.db1.echo = False
146 sqlalchemy.db1.echo = True
147 #sqlalchemy.db1.pool_recycle = 3600
147 sqlalchemy.db1.pool_recycle = 3600
148 sqlalchemy.convert_unicode = true
148 sqlalchemy.convert_unicode = true
149
149
150 ################################
150 ################################
151 ### LOGGING CONFIGURATION ####
151 ### LOGGING CONFIGURATION ####
152 ################################
152 ################################
153 [loggers]
153 [loggers]
154 keys = root, routes, rhodecode, sqlalchemy,beaker,templates
154 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
155
155
156 [handlers]
156 [handlers]
157 keys = console
157 keys = console, console_sql
158
158
159 [formatters]
159 [formatters]
160 keys = generic,color_formatter
160 keys = generic, color_formatter, color_formatter_sql
161
161
162 #############
162 #############
163 ## LOGGERS ##
163 ## LOGGERS ##
164 #############
164 #############
165 [logger_root]
165 [logger_root]
166 level = NOTSET
166 level = NOTSET
167 handlers = console
167 handlers = console
168
168
169 [logger_routes]
169 [logger_routes]
170 level = DEBUG
170 level = DEBUG
171 handlers = console
171 handlers =
172 qualname = routes.middleware
172 qualname = routes.middleware
173 # "level = DEBUG" logs the route matched and routing variables.
173 # "level = DEBUG" logs the route matched and routing variables.
174 propagate = 0
174 propagate = 1
175
175
176 [logger_beaker]
176 [logger_beaker]
177 level = ERROR
177 level = DEBUG
178 handlers = console
178 handlers =
179 qualname = beaker.container
179 qualname = beaker.container
180 propagate = 0
180 propagate = 1
181
181
182 [logger_templates]
182 [logger_templates]
183 level = INFO
183 level = INFO
184 handlers = console
184 handlers =
185 qualname = pylons.templating
185 qualname = pylons.templating
186 propagate = 0
186 propagate = 1
187
187
188 [logger_rhodecode]
188 [logger_rhodecode]
189 level = DEBUG
189 level = DEBUG
190 handlers = console
190 handlers =
191 qualname = rhodecode
191 qualname = rhodecode
192 propagate = 0
192 propagate = 1
193
193
194 [logger_sqlalchemy]
194 [logger_sqlalchemy]
195 level = ERROR
195 level = INFO
196 handlers = console
196 handlers = console_sql
197 qualname = sqlalchemy.engine
197 qualname = sqlalchemy.engine
198 propagate = 0
198 propagate = 0
199
199
200 ##############
200 ##############
201 ## HANDLERS ##
201 ## HANDLERS ##
202 ##############
202 ##############
203
203
204 [handler_console]
204 [handler_console]
205 class = StreamHandler
205 class = StreamHandler
206 args = (sys.stderr,)
206 args = (sys.stderr,)
207 level = NOTSET
207 level = NOTSET
208 formatter = color_formatter
208 formatter = color_formatter
209
209
210 [handler_console_sql]
211 class = StreamHandler
212 args = (sys.stderr,)
213 level = NOTSET
214 formatter = color_formatter_sql
215
210 ################
216 ################
211 ## FORMATTERS ##
217 ## FORMATTERS ##
212 ################
218 ################
213
219
214 [formatter_generic]
220 [formatter_generic]
215 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
221 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
216 datefmt = %Y-%m-%d %H:%M:%S
222 datefmt = %Y-%m-%d %H:%M:%S
217
223
218 [formatter_color_formatter]
224 [formatter_color_formatter]
219 class=rhodecode.lib.colored_formatter.ColorFormatter
225 class=rhodecode.lib.colored_formatter.ColorFormatter
220 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
226 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
227 datefmt = %Y-%m-%d %H:%M:%S
228
229 [formatter_color_formatter_sql]
230 class=rhodecode.lib.colored_formatter.ColorFormatterSql
231 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
221 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
232 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,220 +1,232 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
9 debug = true
9 debug = true
10 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25 #smtp_use_ssl = true
25 #smtp_use_ssl = true
26
26
27 [server:main]
27 [server:main]
28 ##nr of threads to spawn
28 ##nr of threads to spawn
29 threadpool_workers = 5
29 threadpool_workers = 5
30
30
31 ##max request before thread respawn
31 ##max request before thread respawn
32 threadpool_max_requests = 6
32 threadpool_max_requests = 10
33
33
34 ##option to use threads of process
34 ##option to use threads of process
35 use_threadpool = true
35 use_threadpool = true
36
36
37 use = egg:Paste#http
37 use = egg:Paste#http
38 host = 127.0.0.1
38 host = 127.0.0.1
39 port = 8001
39 port = 8001
40
40
41 [app:main]
41 [app:main]
42 use = egg:rhodecode
42 use = egg:rhodecode
43 full_stack = true
43 full_stack = true
44 static_files = false
44 static_files = true
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 app_instance_uuid = prod1234
48 cut_off_limit = 256000
49 cut_off_limit = 256000
49 force_https = false
50 force_https = false
50 commit_parse_limit = 25
51 commit_parse_limit = 50
51 use_gravatar = true
52 use_gravatar = true
52
53
53 ####################################
54 ####################################
54 ### CELERY CONFIG ####
55 ### CELERY CONFIG ####
55 ####################################
56 ####################################
56 use_celery = false
57 use_celery = false
57 broker.host = localhost
58 broker.host = localhost
58 broker.vhost = rabbitmqhost
59 broker.vhost = rabbitmqhost
59 broker.port = 5672
60 broker.port = 5672
60 broker.user = rabbitmq
61 broker.user = rabbitmq
61 broker.password = qweqwe
62 broker.password = qweqwe
62
63
63 celery.imports = rhodecode.lib.celerylib.tasks
64 celery.imports = rhodecode.lib.celerylib.tasks
64
65
65 celery.result.backend = amqp
66 celery.result.backend = amqp
66 celery.result.dburi = amqp://
67 celery.result.dburi = amqp://
67 celery.result.serialier = json
68 celery.result.serialier = json
68
69
69 #celery.send.task.error.emails = true
70 #celery.send.task.error.emails = true
70 #celery.amqp.task.result.expires = 18000
71 #celery.amqp.task.result.expires = 18000
71
72
72 celeryd.concurrency = 2
73 celeryd.concurrency = 2
73 #celeryd.log.file = celeryd.log
74 #celeryd.log.file = celeryd.log
74 celeryd.log.level = debug
75 celeryd.log.level = debug
75 celeryd.max.tasks.per.child = 1
76 celeryd.max.tasks.per.child = 1
76
77
77 #tasks will never be sent to the queue, but executed locally instead.
78 #tasks will never be sent to the queue, but executed locally instead.
78 celery.always.eager = false
79 celery.always.eager = false
79
80
80 ####################################
81 ####################################
81 ### BEAKER CACHE ####
82 ### BEAKER CACHE ####
82 ####################################
83 ####################################
83 beaker.cache.data_dir=%(here)s/data/cache/data
84 beaker.cache.data_dir=%(here)s/data/cache/data
84 beaker.cache.lock_dir=%(here)s/data/cache/lock
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
85
86
86 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
87
88
88 beaker.cache.super_short_term.type=memory
89 beaker.cache.super_short_term.type=memory
89 beaker.cache.super_short_term.expire=10
90 beaker.cache.super_short_term.expire=10
90
91
91 beaker.cache.short_term.type=memory
92 beaker.cache.short_term.type=memory
92 beaker.cache.short_term.expire=60
93 beaker.cache.short_term.expire=60
93
94
94 beaker.cache.long_term.type=memory
95 beaker.cache.long_term.type=memory
95 beaker.cache.long_term.expire=36000
96 beaker.cache.long_term.expire=36000
96
97
97 beaker.cache.sql_cache_short.type=memory
98 beaker.cache.sql_cache_short.type=memory
98 beaker.cache.sql_cache_short.expire=10
99 beaker.cache.sql_cache_short.expire=10
99
100
100 beaker.cache.sql_cache_med.type=memory
101 beaker.cache.sql_cache_med.type=memory
101 beaker.cache.sql_cache_med.expire=360
102 beaker.cache.sql_cache_med.expire=360
102
103
103 beaker.cache.sql_cache_long.type=file
104 beaker.cache.sql_cache_long.type=file
104 beaker.cache.sql_cache_long.expire=3600
105 beaker.cache.sql_cache_long.expire=3600
105
106
106 ####################################
107 ####################################
107 ### BEAKER SESSION ####
108 ### BEAKER SESSION ####
108 ####################################
109 ####################################
109 ## Type of storage used for the session, current types are
110 ## Type of storage used for the session, current types are
110 ## dbm, file, memcached, database, and memory.
111 ## dbm, file, memcached, database, and memory.
111 ## The storage uses the Container API
112 ## The storage uses the Container API
112 ##that is also used by the cache system.
113 ##that is also used by the cache system.
113 beaker.session.type = file
114 beaker.session.type = file
114
115
115 beaker.session.key = rhodecode
116 beaker.session.key = rhodecode
116 beaker.session.secret = g654dcno0-9873jhgfreyu
117 beaker.session.secret = g654dcno0-9873jhgfreyu
117 beaker.session.timeout = 36000
118 beaker.session.timeout = 36000
118
119
119 ##auto save the session to not to use .save()
120 ##auto save the session to not to use .save()
120 beaker.session.auto = False
121 beaker.session.auto = False
121
122
122 ##true exire at browser close
123 ##true exire at browser close
123 #beaker.session.cookie_expires = 3600
124 #beaker.session.cookie_expires = 3600
124
125
125
126
126 ################################################################################
127 ################################################################################
127 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
128 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
129 ## execute malicious code after an exception is raised. ##
130 ## execute malicious code after an exception is raised. ##
130 ################################################################################
131 ################################################################################
131 set debug = false
132 set debug = false
132
133
133 ##################################
134 ##################################
134 ### LOGVIEW CONFIG ###
135 ### LOGVIEW CONFIG ###
135 ##################################
136 ##################################
136 logview.sqlalchemy = #faa
137 logview.sqlalchemy = #faa
137 logview.pylons.templating = #bfb
138 logview.pylons.templating = #bfb
138 logview.pylons.util = #eee
139 logview.pylons.util = #eee
139
140
140 #########################################################
141 #########################################################
141 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
142 #########################################################
143 #########################################################
143 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
144 #sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
144 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
145 sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode
145 #sqlalchemy.db1.echo = False
146 sqlalchemy.db1.echo = True
146 #sqlalchemy.db1.pool_recycle = 3600
147 sqlalchemy.db1.pool_recycle = 3600
147 sqlalchemy.convert_unicode = true
148 sqlalchemy.convert_unicode = true
148
149
149 ################################
150 ################################
150 ### LOGGING CONFIGURATION ####
151 ### LOGGING CONFIGURATION ####
151 ################################
152 ################################
152 [loggers]
153 [loggers]
153 keys = root, routes, rhodecode, sqlalchemy,beaker,templates
154 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
154
155
155 [handlers]
156 [handlers]
156 keys = console
157 keys = console, console_sql
157
158
158 [formatters]
159 [formatters]
159 keys = generic,color_formatter
160 keys = generic, color_formatter, color_formatter_sql
160
161
161 #############
162 #############
162 ## LOGGERS ##
163 ## LOGGERS ##
163 #############
164 #############
164 [logger_root]
165 [logger_root]
165 level = INFO
166 level = NOTSET
166 handlers = console
167 handlers = console
167
168
168 [logger_routes]
169 [logger_routes]
169 level = INFO
170 level = DEBUG
170 handlers = console
171 handlers =
171 qualname = routes.middleware
172 qualname = routes.middleware
172 # "level = DEBUG" logs the route matched and routing variables.
173 # "level = DEBUG" logs the route matched and routing variables.
173 propagate = 0
174 propagate = 1
174
175
175 [logger_beaker]
176 [logger_beaker]
176 level = ERROR
177 level = DEBUG
177 handlers = console
178 handlers =
178 qualname = beaker.container
179 qualname = beaker.container
179 propagate = 0
180 propagate = 1
180
181
181 [logger_templates]
182 [logger_templates]
182 level = INFO
183 level = INFO
183 handlers = console
184 handlers =
184 qualname = pylons.templating
185 qualname = pylons.templating
185 propagate = 0
186 propagate = 1
186
187
187 [logger_rhodecode]
188 [logger_rhodecode]
188 level = DEBUG
189 level = DEBUG
189 handlers = console
190 handlers =
190 qualname = rhodecode
191 qualname = rhodecode
191 propagate = 0
192 propagate = 1
192
193
193 [logger_sqlalchemy]
194 [logger_sqlalchemy]
194 level = ERROR
195 level = INFO
195 handlers = console
196 handlers = console_sql
196 qualname = sqlalchemy.engine
197 qualname = sqlalchemy.engine
197 propagate = 0
198 propagate = 0
198
199
199 ##############
200 ##############
200 ## HANDLERS ##
201 ## HANDLERS ##
201 ##############
202 ##############
202
203
203 [handler_console]
204 [handler_console]
204 class = StreamHandler
205 class = StreamHandler
205 args = (sys.stderr,)
206 args = (sys.stderr,)
206 level = NOTSET
207 level = INFO
207 formatter = color_formatter
208 formatter = color_formatter
208
209
210 [handler_console_sql]
211 class = StreamHandler
212 args = (sys.stderr,)
213 level = WARN
214 formatter = color_formatter_sql
215
209 ################
216 ################
210 ## FORMATTERS ##
217 ## FORMATTERS ##
211 ################
218 ################
212
219
213 [formatter_generic]
220 [formatter_generic]
214 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
221 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
215 datefmt = %Y-%m-%d %H:%M:%S
222 datefmt = %Y-%m-%d %H:%M:%S
216
223
217 [formatter_color_formatter]
224 [formatter_color_formatter]
218 class=rhodecode.lib.colored_formatter.ColorFormatter
225 class=rhodecode.lib.colored_formatter.ColorFormatter
219 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
226 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
227 datefmt = %Y-%m-%d %H:%M:%S
228
229 [formatter_color_formatter_sql]
230 class=rhodecode.lib.colored_formatter.ColorFormatterSql
231 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
220 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
232 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,220 +1,231 b''
1 ################################################################################
1 ################################################################################
2 ################################################################################
2 ################################################################################
3 # RhodeCode - Pylons environment configuration #
3 # RhodeCode - Pylons environment configuration #
4 # #
4 # #
5 # The %(here)s variable will be replaced with the parent directory of this file#
5 # The %(here)s variable will be replaced with the parent directory of this file#
6 ################################################################################
6 ################################################################################
7
7
8 [DEFAULT]
8 [DEFAULT]
9 debug = true
9 debug = true
10 ################################################################################
10 ################################################################################
11 ## Uncomment and replace with the address which should receive ##
11 ## Uncomment and replace with the address which should receive ##
12 ## any error reports after application crash ##
12 ## any error reports after application crash ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
13 ## Additionally those settings will be used by RhodeCode mailing system ##
14 ################################################################################
14 ################################################################################
15 #email_to = admin@localhost
15 #email_to = admin@localhost
16 #error_email_from = paste_error@localhost
16 #error_email_from = paste_error@localhost
17 #app_email_from = rhodecode-noreply@localhost
17 #app_email_from = rhodecode-noreply@localhost
18 #error_message =
18 #error_message =
19
19
20 #smtp_server = mail.server.com
20 #smtp_server = mail.server.com
21 #smtp_username =
21 #smtp_username =
22 #smtp_password =
22 #smtp_password =
23 #smtp_port =
23 #smtp_port =
24 #smtp_use_tls = false
24 #smtp_use_tls = false
25 #smtp_use_ssl = true
25 #smtp_use_ssl = true
26
26
27 [server:main]
27 [server:main]
28 ##nr of threads to spawn
28 ##nr of threads to spawn
29 threadpool_workers = 5
29 threadpool_workers = 5
30
30
31 ##max request before thread respawn
31 ##max request before thread respawn
32 threadpool_max_requests = 10
32 threadpool_max_requests = 10
33
33
34 ##option to use threads of process
34 ##option to use threads of process
35 use_threadpool = true
35 use_threadpool = true
36
36
37 use = egg:Paste#http
37 use = egg:Paste#http
38 host = 127.0.0.1
38 host = 127.0.0.1
39 port = 5000
39 port = 5000
40
40
41 [app:main]
41 [app:main]
42 use = egg:rhodecode
42 use = egg:rhodecode
43 full_stack = true
43 full_stack = true
44 static_files = true
44 static_files = true
45 lang=en
45 lang=en
46 cache_dir = %(here)s/data
46 cache_dir = %(here)s/data
47 index_dir = %(here)s/data/index
47 index_dir = %(here)s/data/index
48 app_instance_uuid = ${app_instance_uuid}
48 app_instance_uuid = ${app_instance_uuid}
49 cut_off_limit = 256000
49 cut_off_limit = 256000
50 force_https = false
50 force_https = false
51 commit_parse_limit = 50
51 commit_parse_limit = 50
52 use_gravatar = true
52 use_gravatar = true
53
53
54 ####################################
54 ####################################
55 ### CELERY CONFIG ####
55 ### CELERY CONFIG ####
56 ####################################
56 ####################################
57 use_celery = false
57 use_celery = false
58 broker.host = localhost
58 broker.host = localhost
59 broker.vhost = rabbitmqhost
59 broker.vhost = rabbitmqhost
60 broker.port = 5672
60 broker.port = 5672
61 broker.user = rabbitmq
61 broker.user = rabbitmq
62 broker.password = qweqwe
62 broker.password = qweqwe
63
63
64 celery.imports = rhodecode.lib.celerylib.tasks
64 celery.imports = rhodecode.lib.celerylib.tasks
65
65
66 celery.result.backend = amqp
66 celery.result.backend = amqp
67 celery.result.dburi = amqp://
67 celery.result.dburi = amqp://
68 celery.result.serialier = json
68 celery.result.serialier = json
69
69
70 #celery.send.task.error.emails = true
70 #celery.send.task.error.emails = true
71 #celery.amqp.task.result.expires = 18000
71 #celery.amqp.task.result.expires = 18000
72
72
73 celeryd.concurrency = 2
73 celeryd.concurrency = 2
74 #celeryd.log.file = celeryd.log
74 #celeryd.log.file = celeryd.log
75 celeryd.log.level = debug
75 celeryd.log.level = debug
76 celeryd.max.tasks.per.child = 1
76 celeryd.max.tasks.per.child = 1
77
77
78 #tasks will never be sent to the queue, but executed locally instead.
78 #tasks will never be sent to the queue, but executed locally instead.
79 celery.always.eager = false
79 celery.always.eager = false
80
80
81 ####################################
81 ####################################
82 ### BEAKER CACHE ####
82 ### BEAKER CACHE ####
83 ####################################
83 ####################################
84 beaker.cache.data_dir=%(here)s/data/cache/data
84 beaker.cache.data_dir=%(here)s/data/cache/data
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
85 beaker.cache.lock_dir=%(here)s/data/cache/lock
86
86
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
87 beaker.cache.regions=super_short_term,short_term,long_term,sql_cache_short,sql_cache_med,sql_cache_long
88
88
89 beaker.cache.super_short_term.type=memory
89 beaker.cache.super_short_term.type=memory
90 beaker.cache.super_short_term.expire=10
90 beaker.cache.super_short_term.expire=10
91
91
92 beaker.cache.short_term.type=memory
92 beaker.cache.short_term.type=memory
93 beaker.cache.short_term.expire=60
93 beaker.cache.short_term.expire=60
94
94
95 beaker.cache.long_term.type=memory
95 beaker.cache.long_term.type=memory
96 beaker.cache.long_term.expire=36000
96 beaker.cache.long_term.expire=36000
97
97
98 beaker.cache.sql_cache_short.type=memory
98 beaker.cache.sql_cache_short.type=memory
99 beaker.cache.sql_cache_short.expire=10
99 beaker.cache.sql_cache_short.expire=10
100
100
101 beaker.cache.sql_cache_med.type=memory
101 beaker.cache.sql_cache_med.type=memory
102 beaker.cache.sql_cache_med.expire=360
102 beaker.cache.sql_cache_med.expire=360
103
103
104 beaker.cache.sql_cache_long.type=file
104 beaker.cache.sql_cache_long.type=file
105 beaker.cache.sql_cache_long.expire=3600
105 beaker.cache.sql_cache_long.expire=3600
106
106
107 ####################################
107 ####################################
108 ### BEAKER SESSION ####
108 ### BEAKER SESSION ####
109 ####################################
109 ####################################
110 ## Type of storage used for the session, current types are
110 ## Type of storage used for the session, current types are
111 ## dbm, file, memcached, database, and memory.
111 ## dbm, file, memcached, database, and memory.
112 ## The storage uses the Container API
112 ## The storage uses the Container API
113 ##that is also used by the cache system.
113 ##that is also used by the cache system.
114 beaker.session.type = file
114 beaker.session.type = file
115
115
116 beaker.session.key = rhodecode
116 beaker.session.key = rhodecode
117 beaker.session.secret = ${app_instance_secret}
117 beaker.session.secret = ${app_instance_secret}
118 beaker.session.timeout = 36000
118 beaker.session.timeout = 36000
119
119
120 ##auto save the session to not to use .save()
120 ##auto save the session to not to use .save()
121 beaker.session.auto = False
121 beaker.session.auto = False
122
122
123 ##true exire at browser close
123 ##true exire at browser close
124 #beaker.session.cookie_expires = 3600
124 #beaker.session.cookie_expires = 3600
125
125
126
126
127 ################################################################################
127 ################################################################################
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
128 ## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
129 ## Debug mode will enable the interactive debugging tool, allowing ANYONE to ##
130 ## execute malicious code after an exception is raised. ##
130 ## execute malicious code after an exception is raised. ##
131 ################################################################################
131 ################################################################################
132 set debug = false
132 set debug = false
133
133
134 ##################################
134 ##################################
135 ### LOGVIEW CONFIG ###
135 ### LOGVIEW CONFIG ###
136 ##################################
136 ##################################
137 logview.sqlalchemy = #faa
137 logview.sqlalchemy = #faa
138 logview.pylons.templating = #bfb
138 logview.pylons.templating = #bfb
139 logview.pylons.util = #eee
139 logview.pylons.util = #eee
140
140
141 #########################################################
141 #########################################################
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
142 ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ###
143 #########################################################
143 #########################################################
144 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
144 sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db
145 #sqlalchemy.db1.echo = False
145 sqlalchemy.db1.echo = True
146 #sqlalchemy.db1.pool_recycle = 3600
146 sqlalchemy.db1.pool_recycle = 3600
147 sqlalchemy.convert_unicode = true
147 sqlalchemy.convert_unicode = true
148
148
149 ################################
149 ################################
150 ### LOGGING CONFIGURATION ####
150 ### LOGGING CONFIGURATION ####
151 ################################
151 ################################
152 [loggers]
152 [loggers]
153 keys = root, routes, rhodecode, sqlalchemy,beaker,templates
153 keys = root, routes, rhodecode, sqlalchemy, beaker, templates
154
154
155 [handlers]
155 [handlers]
156 keys = console
156 keys = console, console_sql
157
157
158 [formatters]
158 [formatters]
159 keys = generic,color_formatter
159 keys = generic, color_formatter, color_formatter_sql
160
160
161 #############
161 #############
162 ## LOGGERS ##
162 ## LOGGERS ##
163 #############
163 #############
164 [logger_root]
164 [logger_root]
165 level = INFO
165 level = NOTSET
166 handlers = console
166 handlers = console
167
167
168 [logger_routes]
168 [logger_routes]
169 level = INFO
169 level = DEBUG
170 handlers = console
170 handlers =
171 qualname = routes.middleware
171 qualname = routes.middleware
172 # "level = DEBUG" logs the route matched and routing variables.
172 # "level = DEBUG" logs the route matched and routing variables.
173 propagate = 0
173 propagate = 1
174
174
175 [logger_beaker]
175 [logger_beaker]
176 level = ERROR
176 level = DEBUG
177 handlers = console
177 handlers =
178 qualname = beaker.container
178 qualname = beaker.container
179 propagate = 0
179 propagate = 1
180
180
181 [logger_templates]
181 [logger_templates]
182 level = INFO
182 level = INFO
183 handlers = console
183 handlers =
184 qualname = pylons.templating
184 qualname = pylons.templating
185 propagate = 0
185 propagate = 1
186
186
187 [logger_rhodecode]
187 [logger_rhodecode]
188 level = DEBUG
188 level = DEBUG
189 handlers = console
189 handlers =
190 qualname = rhodecode
190 qualname = rhodecode
191 propagate = 0
191 propagate = 1
192
192
193 [logger_sqlalchemy]
193 [logger_sqlalchemy]
194 level = ERROR
194 level = INFO
195 handlers = console
195 handlers = console_sql
196 qualname = sqlalchemy.engine
196 qualname = sqlalchemy.engine
197 propagate = 0
197 propagate = 0
198
198
199 ##############
199 ##############
200 ## HANDLERS ##
200 ## HANDLERS ##
201 ##############
201 ##############
202
202
203 [handler_console]
203 [handler_console]
204 class = StreamHandler
204 class = StreamHandler
205 args = (sys.stderr,)
205 args = (sys.stderr,)
206 level = NOTSET
206 level = INFO
207 formatter = color_formatter
207 formatter = color_formatter
208
208
209 [handler_console_sql]
210 class = StreamHandler
211 args = (sys.stderr,)
212 level = WARN
213 formatter = color_formatter_sql
214
209 ################
215 ################
210 ## FORMATTERS ##
216 ## FORMATTERS ##
211 ################
217 ################
212
218
213 [formatter_generic]
219 [formatter_generic]
214 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
220 format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
215 datefmt = %Y-%m-%d %H:%M:%S
221 datefmt = %Y-%m-%d %H:%M:%S
216
222
217 [formatter_color_formatter]
223 [formatter_color_formatter]
218 class=rhodecode.lib.colored_formatter.ColorFormatter
224 class=rhodecode.lib.colored_formatter.ColorFormatter
219 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
225 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
226 datefmt = %Y-%m-%d %H:%M:%S
227
228 [formatter_color_formatter_sql]
229 class=rhodecode.lib.colored_formatter.ColorFormatterSql
230 format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
220 datefmt = %Y-%m-%d %H:%M:%S No newline at end of file
231 datefmt = %Y-%m-%d %H:%M:%S
@@ -1,38 +1,83 b''
1
1
2 import logging
2 import logging
3
3
4 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
4 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
5
5
6 # Sequences
6 # Sequences
7 RESET_SEQ = "\033[0m"
7 RESET_SEQ = "\033[0m"
8 COLOR_SEQ = "\033[1;%dm"
8 COLOR_SEQ = "\033[1;%dm"
9 BOLD_SEQ = "\033[1m"
9 BOLD_SEQ = "\033[1m"
10
10
11 COLORS = {
11 COLORS = {
12 'CRITICAL': MAGENTA, # level 50
12 'CRITICAL': MAGENTA, # level 50
13 'ERROR': RED, # level 40
13 'ERROR': RED, # level 40
14 'WARNING': CYAN, # level 30
14 'WARNING': CYAN, # level 30
15 'INFO': GREEN, # level 20
15 'INFO': GREEN, # level 20
16 'DEBUG': BLUE, # level 10
16 'DEBUG': BLUE, # level 10
17 'SQL' : YELLOW
17 }
18 }
18
19
20 def one_space_trim(s):
21 if s.find(" ") == -1:
22 return s
23 else:
24 s = s.replace(' ', ' ')
25 return one_space_trim(s)
26
27 def format_sql(sql):
28 sql = sql.replace('\n', '')
29 sql = one_space_trim(sql)
30 sql = sql\
31 .replace(',', ',\n\t')\
32 .replace('SELECT', '\n\tSELECT \n\t')\
33 .replace('UPDATE', '\n\tUPDATE \n\t')\
34 .replace('DELETE', '\n\tDELETE \n\t')\
35 .replace('FROM', '\n\tFROM')\
36 .replace('ORDER BY', '\n\tORDER BY')\
37 .replace('LIMIT', '\n\tLIMIT')\
38 .replace('WHERE', '\n\tWHERE')\
39 .replace('AND', '\n\tAND')\
40 .replace('LEFT', '\n\tLEFT')\
41 .replace('INNER', '\n\tINNER')\
42 .replace('INSERT', '\n\tINSERT')\
43 .replace('DELETE', '\n\tDELETE')
44 return sql
45
19 class ColorFormatter(logging.Formatter):
46 class ColorFormatter(logging.Formatter):
20
47
21 def __init__(self, *args, **kwargs):
48 def __init__(self, *args, **kwargs):
22 # can't do super(...) here because Formatter is an old school class
49 # can't do super(...) here because Formatter is an old school class
23 logging.Formatter.__init__(self, *args, **kwargs)
50 logging.Formatter.__init__(self, *args, **kwargs)
24
51
25 def format(self, record):
52 def format(self, record):
26 """
53 """
27 Changes record's levelname to use with COLORS enum
54 Changes record's levelname to use with COLORS enum
28 """
55 """
29
56
30 levelname = record.levelname
57 levelname = record.levelname
31 start = COLOR_SEQ % (COLORS[levelname])
58 start = COLOR_SEQ % (COLORS[levelname])
32 def_record = logging.Formatter.format(self, record)
59 def_record = logging.Formatter.format(self, record)
33 end = RESET_SEQ
60 end = RESET_SEQ
34
61
35 colored_record = start + def_record + end
62 colored_record = start + def_record + end
36 return colored_record
63 return colored_record
37
64
38 logging.ColorFormatter = ColorFormatter
65
66 class ColorFormatterSql(logging.Formatter):
67
68 def __init__(self, *args, **kwargs):
69 # can't do super(...) here because Formatter is an old school class
70 logging.Formatter.__init__(self, *args, **kwargs)
71
72 def format(self, record):
73 """
74 Changes record's levelname to use with COLORS enum
75 """
76
77 start = COLOR_SEQ % (COLORS['SQL'])
78 def_record = format_sql(logging.Formatter.format(self, record))
79 end = RESET_SEQ
80
81 colored_record = start + def_record + end
82 return colored_record
83
@@ -1,59 +1,28 b''
1 from sqlalchemy.interfaces import ConnectionProxy
1 from sqlalchemy.interfaces import ConnectionProxy
2 import time
2 import time
3 from sqlalchemy import log
3 from sqlalchemy import log
4 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
4 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
5
5
6 def color_sql(sql):
6 def color_sql(sql):
7 COLOR_SEQ = "\033[1;%dm"
7 COLOR_SEQ = "\033[1;%dm"
8 COLOR_SQL = YELLOW
8 COLOR_SQL = YELLOW
9 normal = '\x1b[0m'
9 normal = '\x1b[0m'
10 return COLOR_SEQ % COLOR_SQL + sql + normal
10 return COLOR_SEQ % COLOR_SQL + sql + normal
11
12 def one_space_trim(s):
13 if s.find(" ") == -1:
14 return s
15 else:
16 s = s.replace(' ', ' ')
17 return one_space_trim(s)
18
19 def format_sql(sql):
20 sql = color_sql(sql)
21 sql = sql.replace('\n', '')
22 sql = one_space_trim(sql)
23 sql = sql\
24 .replace(',', ',\n\t')\
25 .replace('SELECT', '\n\tSELECT \n\t')\
26 .replace('UPDATE', '\n\tUPDATE \n\t')\
27 .replace('DELETE', '\n\tDELETE \n\t')\
28 .replace('FROM', '\n\tFROM')\
29 .replace('ORDER BY', '\n\tORDER BY')\
30 .replace('LIMIT', '\n\tLIMIT')\
31 .replace('WHERE', '\n\tWHERE')\
32 .replace('AND', '\n\tAND')\
33 .replace('LEFT', '\n\tLEFT')\
34 .replace('INNER', '\n\tINNER')\
35 .replace('INSERT', '\n\tINSERT')\
36 .replace('DELETE', '\n\tDELETE')
37 return sql
38
39
11
40 class TimerProxy(ConnectionProxy):
12 class TimerProxy(ConnectionProxy):
41
13
42 def __init__(self):
14 def __init__(self):
43 super(TimerProxy, self).__init__()
15 super(TimerProxy, self).__init__()
44 self.logging_name = 'timerProxy'
16 self.logging_name = 'timerProxy'
45 self.log = log.instance_logger(self, True)
17 self.log = log.instance_logger(self, True)
46
18
47 def cursor_execute(self, execute, cursor, statement, parameters, context, executemany):
19 def cursor_execute(self, execute, cursor, statement, parameters,
48
20 context, executemany):
21
49 now = time.time()
22 now = time.time()
50 try:
23 try:
51 self.log.info(">>>>> STARTING QUERY >>>>>")
24 self.log.info(color_sql(">>>>> STARTING QUERY >>>>>"))
52 return execute(cursor, statement, parameters, context)
25 return execute(cursor, statement, parameters, context)
53 finally:
26 finally:
54 total = time.time() - now
27 total = time.time() - now
55 try:
28 self.log.info(color_sql("<<<<< TOTAL TIME: %f <<<<<" % total))
56 self.log.info(format_sql("Query: %s" % statement % parameters))
57 except TypeError:
58 self.log.info(format_sql("Query: %s %s" % (statement, parameters)))
59 self.log.info("<<<<< TOTAL TIME: %f <<<<<" % total)
General Comments 0
You need to be logged in to leave comments. Login now