-
-
Notifications
You must be signed in to change notification settings - Fork 59
Description
self.request_logger = logging.getLogger('flask-request-logger')
self.request_logger.setLevel(logging.DEBUG)
self.request_logger.addHandler(logging.StreamHandler(sys.stdout))
how can i config request_logger to flase? the default value is true.
my config is:
logging.basicConfig()
json_logging.ENABLE_JSON_LOGGING = True
json_logging.init(framework_name='flask')
json_logging.config_root_logger()
json_logging.init_request_instrument(app)
and the log is:
{"type": "request", "written_at": "2019-07-03T12:27:16.821Z", "written_ts": 1562156836821808000, "component_id": "-", "component_name": "-", "component_instance": 0, "correlation_id": "e4ec9c62-9d8d-11e9-8c23-8c8590b281d8", "remote_user": "-", "request": "/smart_counter/api/v1/goods/1", "referer": "-", "x_forwarded_for": "-", "protocol": "HTTP/1.1", "method": "GET", "remote_ip": "127.0.0.1", "request_size_b": -1, "remote_host": "127.0.0.1", "remote_port": 50725, "request_received_at": "2019-07-03T12:27:16.528Z", "response_time_ms": 292, "response_status": 200, "response_size_b": 1639, "response_content_type": "application/json", "response_sent_at": "2019-07-03T12:27:16.821Z"}
{"type": "log", "written_at": "2019-07-03T12:27:16.823Z", "written_ts": 1562156836823116000, "component_id": "-", "component_name": "-", "component_instance": 0, "logger": "flask-request-logger", "thread": "Thread-6", "level": "INFO", "module": "init", "line_no": 57, "correlation_id": "e4ec9c62-9d8d-11e9-8c23-8c8590b281d8", "msg": ""}
the second seems to be redudant, and logged by root? how can i disable the second, and just retain first log item