|
@@ -163,20 +163,20 @@ class JsonFormatter(logging.Formatter):
|
163
|
163
|
return json.dumps(obj)
|
164
|
164
|
|
165
|
165
|
|
166
|
|
-def appLoggingConfigure(basepath, target, log_name_lvl=[], fmt=SHORT_FMT, ring_logs=None, host=None, port=None):
|
|
166
|
+def appLoggingConfigure(basepath, target, log_name_lvl=[], target_level=logging.DEBUG, fmt=SHORT_FMT, ring_logs=None, host=None, port=None):
|
167
|
167
|
target_handlers = ['main', ]
|
168
|
168
|
# define handler
|
169
|
169
|
#
|
170
|
170
|
if target == 'stdout':
|
171
|
171
|
handler = dict(main={
|
172
|
|
- 'level': 'DEBUG',
|
|
172
|
+ 'level': logging.getLevelName(target_level),
|
173
|
173
|
'formatter': 'format',
|
174
|
174
|
'class': 'logging.StreamHandler',
|
175
|
175
|
'stream': 'ext://sys.stdout',
|
176
|
176
|
})
|
177
|
177
|
elif target == 'logfile':
|
178
|
178
|
handler = dict(main={
|
179
|
|
- 'level': 'DEBUG',
|
|
179
|
+ 'level': logging.getLevelName(target_level),
|
180
|
180
|
'formatter': 'json',
|
181
|
181
|
'class': 'logging.handlers.RotatingFileHandler',
|
182
|
182
|
'filename': os.path.join(basepath, 'messages.log'),
|