code: def test_application_logging_overwrite(self, serve_and_ray_shutdown):
      @serve.deployment
      class Model:
          def __call__(self, req: starlette.requests.Request):
              logger = logging.getLogger("ray.serve")
              logger.info("model_info_level")
              logger.debug("model_debug_level")
              return {
                  "log_file": logger.handlers[1].baseFilename,
              }
  
      serve.run(Model.bind(), logging_config={"log_level": "DEBUG"})
      resp = requests.get("http://127.0.0.1:8000/").json()
      expected_log_regex = [
          ".*model_info_level.*",
          ".*model_debug_level.*",
      ]
      check_log_file(resp["log_file"], expected_log_regex)
  
      # Setting logging config in the deployment level, application
      # config can't override it.
  
      @serve.deployment(logging_config={"log_level": "INFO"})
      class Model2:
          def __call__(self, req: starlette.requests.Request):
              logger = logging.getLogger("ray.serve")
              logger.info("model_info_level")
              logger.debug("model_debug_level")
              return {
                  "log_file": logger.handlers[1].baseFilename,
              }
  
      serve.run(
          Model2.bind(),
          logging_config={"log_level": "DEBUG"},
          name="app2",
          route_prefix="/app2",
      )
      resp = requests.get("http://127.0.0.1:8000/app2").json()
      check_log_file(resp["log_file"], [".*model_info_level.*"])
      # Make sure 'model_debug_level' log content does not exist.
      with pytest.raises(AssertionError):
          check_log_file(resp["log_file"], [".*model_debug_level.*"])
  
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 6 for calling the TestLoggingAPI obj's underlying member method code with example usage: obj.test_application_logging_overwrite(serve_and_ray_shutdown) and returns: dict, dict