diff --git a/python/ray/serve/_private/logging_utils.py b/python/ray/serve/_private/logging_utils.py index 010428410636d..8308b056ccf7e 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 31b66685d3884..3c95d977dc76e 100644 --- a/python/ray/serve/tests/test_logging.py +++ b/python/ray/serve/tests/test_logging.py @@ -604,6 +604,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 diff --git a/serve/serve_40797.log b/serve/serve_40797.log deleted file mode 100644 index e69de29bb2d1d..0000000000000