code: def test_json_log_formatter(is_replica_type_component):
      """Test the json log formatter"""
  
      if is_replica_type_component:
          component_type = ServeComponentType.REPLICA
          formatter = ServeJSONFormatter(
              "component", "component_id", component_type
          )
      else:
          formatter = ServeJSONFormatter("component", "component_id")
      init_kwargs = {
          "name": "test_log",
          "level": logging.DEBUG,
          "pathname": "my_path",
          "lineno": 1,
          "msg": "my_message",
          "args": (),
          "exc_info": None,
      }
      record = logging.LogRecord(**init_kwargs)
  
      def format_and_verify_json_output(record, expected_record: dict):
          formatted_record = formatter.format(record)
          formatted_record_dict = json.loads(formatted_record)
          for key in expected_record:
              assert key in formatted_record_dict
              assert formatted_record_dict[key] == expected_record[key]
  
      expected_json = {}
      if is_replica_type_component:
          expected_json["deployment"] = "component"
          expected_json["replica"] = "component_id"
  
      # Set request id
      record.request_id = "request_id"
      expected_json["request_id"] = "request_id"
      format_and_verify_json_output(record, expected_json)
  
      # Set route
      record.route = "route"
      expected_json["route"] = "route"
      format_and_verify_json_output(record, expected_json)
  
      # set application
      record.application = "application"
      expected_json["application"] = "application"
      format_and_verify_json_output(record, expected_json)
  
imports: import io
  import json
  import logging
  import os
  import re
  import string
  import sys
  import time
  from contextlib import redirect_stderr
  import pytest
  import requests
  import starlette
  import ray
  import ray.util.state
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.common import ServeComponentType
  from ray.serve._private.constants import SERVE_LOG_EXTRA_FIELDS
  from ray.serve._private.logging_utils import ServeJSONFormatter, get_component_log_file_name, get_serve_logs_dir
label_desc: Use image node_id 12 for calling a global function with example usage: test_json_log_formatter(is_replica_type_component) without return types