code: def test_logs_dir(self, serve_and_ray_shutdown):
      logger = logging.getLogger("ray.serve")
  
      @serve.deployment
      class Model:
          def __call__(self, req: starlette.requests.Request):
              logger.info("model_info_level")
              return {
                  "logs_path": logger.handlers[1].baseFilename,
              }
  
      serve.run(Model.bind())
      resp = requests.get("http://127.0.0.1:8000/").json()
  
      paths = resp["logs_path"].split("/")
      paths[-1] = "new_dir"
      new_log_dir = "/".join(paths)
  
      serve.run(
          Model.options(logging_config={"logs_dir": new_log_dir}).bind()
      )
      resp = requests.get("http://127.0.0.1:8000/").json()
      assert "new_dir" in resp["logs_path"]
  
      check_log_file(resp["logs_path"], [".*model_info_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 4 for calling the TestLoggingAPI obj's underlying member method code with example usage: obj.test_logs_dir(serve_and_ray_shutdown) and returns: dict