From a0c2ac42ee9ec4b844a5799b5572aa8e03c16b20 Mon Sep 17 00:00:00 2001 From: Max Lowther Date: Tue, 20 Feb 2024 15:58:39 +0000 Subject: [PATCH] fix(logging): adserver is very noisy for feedback requests, possibly affecting performance (#5351) --- components/alibi-detect-server/adserver/cm_model.py | 5 ++--- components/alibi-detect-server/adserver/server.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/alibi-detect-server/adserver/cm_model.py b/components/alibi-detect-server/adserver/cm_model.py index 33f4bdcc46..5ab6dcea8c 100644 --- a/components/alibi-detect-server/adserver/cm_model.py +++ b/components/alibi-detect-server/adserver/cm_model.py @@ -97,8 +97,7 @@ def process_event(self, inputs: Union[List, Dict], headers: Dict) -> Optional[Mo """ logging.info("PROCESSING Feedback Event.") - logging.info(str(headers)) - logging.info("----") + logging.debug(str(headers)) metrics: List[Dict] = [] output: Dict = {} @@ -161,7 +160,7 @@ def process_event(self, inputs: Union[List, Dict], headers: Dict) -> Optional[Mo error, status_code=400, reason="METRICS_SERVER_ERROR" ) - logging.error(f"{truth}, {response}") + logging.info(f"truth: {truth}, response: {response}") metrics_transformed = self.model.transform(truth, response) metrics.extend(metrics_transformed.metrics) diff --git a/components/alibi-detect-server/adserver/server.py b/components/alibi-detect-server/adserver/server.py index 95351003de..7b0232de7a 100644 --- a/components/alibi-detect-server/adserver/server.py +++ b/components/alibi-detect-server/adserver/server.py @@ -260,10 +260,10 @@ def post(self): if not self.reply_url == "": logging.debug(json.dumps(revent.Properties())) - logging.info("binary CloudEvent") + logging.debug("binary CloudEvent") for k, v in revent_headers.items(): - logging.info("{0}: {1}\r\n".format(k, v)) - logging.info(revent_data) + logging.debug("{0}: {1}\r\n".format(k, v)) + logging.debug(revent_data) forward_request(revent_headers, revent_data, self.reply_url) self.set_header("Content-Type", "application/json")