diff --git a/python/ray/serve/_private/logging_utils.py b/python/ray/serve/_private/logging_utils.py index d85329ded1666..207f0574c317d 100644 --- a/python/ray/serve/_private/logging_utils.py +++ b/python/ray/serve/_private/logging_utils.py @@ -69,7 +69,7 @@ def filter(self, record: logging.LogRecord) -> bool: setattr(record, SERVE_LOG_COMPONENT, self.component_type) else: setattr(record, SERVE_LOG_COMPONENT, self.component_name) - setattr(record, SERVE_LOG_REPLICA, self.component_id) + setattr(record, SERVE_LOG_COMPONENT_ID, self.component_id) return True diff --git a/python/ray/serve/tests/test_logging.py b/python/ray/serve/tests/test_logging.py index 6bb3b20f8571f..e3cf663178a4a 100644 --- a/python/ray/serve/tests/test_logging.py +++ b/python/ray/serve/tests/test_logging.py @@ -606,6 +606,10 @@ def format_and_verify_json_output(record, expected_record: dict): if is_replica_type_component: expected_json["deployment"] = "component" expected_json["replica"] = "component_id" + expected_json["component_name"] = "replica" + else: + expected_json["component_name"] = "component" + expected_json["component_id"] = "component_id" # Ensure message exists in the output. # Note that there is no "message" key in the record dict until it has been