prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Problems with own logging configuration
  Currently I have the problem that my logging configuration is not accepted everywhere. As soon as the REST server starts (Uvicorn Worker), my logging configuration is ignored. I have created a repo that represents my scenario and also which is configuration used. Maybe my configuration is just wrong. In the model itself, I print out all the loggers and the associated handlers and formatter and can see here that it should actually fit. Do you have any ideas?
  
  Here is my small example repo: https://github.com/JustinDroege/mlserver-logging
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mlserver/metrics/server.py`
  Content:
  ```
  1 import uvicorn
  2 
  3 from fastapi import FastAPI
  4 from starlette_exporter import handle_metrics
  5 
  6 from ..settings import Settings
  7 from .logging import logger
  8 from typing import Optional
  9 
  10 
  11 class _NoSignalServer(uvicorn.Server):
  12     def install_signal_handlers(self):
  13         pass
  14 
  15 
  16 class MetricsServer:
  17     def __init__(self, settings: Settings):
  18         self._settings = settings
  19         self._app = self._get_app()
  20 
  21     def _get_app(self):
  22         app = FastAPI(debug=self._settings.debug)
  23         app.add_route(self._settings.metrics_endpoint, handle_metrics)
  24         return app
  25 
  26     async def start(self):
  27         cfg = self._get_config()
  28         self._server = _NoSignalServer(cfg)
  29 
  30         metrics_server = f"http://{self._settings.host}:{self._settings.metrics_port}"
  31         logger.info(f"Metrics server running on {metrics_server}")
  32         logger.info(
  33             "Prometheus scraping endpoint can be accessed on "
  34             f"{metrics_server}{self._settings.metrics_endpoint}"
  35         )
  36         await self._server.serve()
  37 
  38     def _get_config(self):
  39         kwargs = {}
  40 
  41         if self._settings._custom_metrics_server_settings:
  42             logger.warning(
  43                 "REST custom configuration is out of support. Use as your own risk"
  44             )
  45             kwargs.update(self._settings._custom_metrics_server_settings)
  46 
  47         kwargs.update(
  48             {
  49                 "host": self._settings.host,
  50                 "port": self._settings.metrics_port,
  51                 "access_log": self._settings.debug,
  52             }
  53         )
  54 
  55         # TODO: we want to disable logger unless debug is enabled (otherwise,
  56         # prom reqs can be spammy)
  57         return uvicorn.Config(self._app, **kwargs)
  58 
  59     async def stop(self, sig: Optional[int] = None):
  60         self._server.handle_exit(sig=sig, frame=None)
  61
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mlserver/metrics/server.py b/mlserver/metrics/server.py
  --- a/mlserver/metrics/server.py
  +++ b/mlserver/metrics/server.py
  @@ -52,8 +52,11 @@
               }
           )
   
  -        # TODO: we want to disable logger unless debug is enabled (otherwise,
  -        # prom reqs can be spammy)
  +        if self._settings.logging_settings:
  +            # If not None, use ours. Otherwise, let Uvicorn fall back on its
  +            # own config.
  +            kwargs.update({"log_config": self._settings.logging_settings})
  +
           return uvicorn.Config(self._app, **kwargs)
   
       async def stop(self, sig: Optional[int] = None):
  
verification_info: {"golden_diff": "diff --git a/mlserver/metrics/server.py b/mlserver/metrics/server.py\n--- a/mlserver/metrics/server.py\n+++ b/mlserver/metrics/server.py\n@@ -52,8 +52,11 @@\n             }\n         )\n \n-        # TODO: we want to disable logger unless debug is enabled (otherwise,\n-        # prom reqs can be spammy)\n+        if self._settings.logging_settings:\n+            # If not None, use ours. Otherwise, let Uvicorn fall back on its\n+            # own config.\n+            kwargs.update({\"log_config\": self._settings.logging_settings})\n+\n         return uvicorn.Config(self._app, **kwargs)\n \n     async def stop(self, sig: Optional[int] = None):\n", "issue": "Problems with own logging configuration\nCurrently I have the problem that my logging configuration is not accepted everywhere. As soon as the REST server starts (Uvicorn Worker), my logging configuration is ignored. I have created a repo that represents my scenario and also which is configuration used. Maybe my configuration is just wrong. In the model itself, I print out all the loggers and the associated handlers and formatter and can see here that it should actually fit. Do you have any ideas?\r\n\r\nHere is my small example repo: https://github.com/JustinDroege/mlserver-logging\n", "before_files": [{"content": "import uvicorn\n\nfrom fastapi import FastAPI\nfrom starlette_exporter import handle_metrics\n\nfrom ..settings import Settings\nfrom .logging import logger\nfrom typing import Optional\n\n\nclass _NoSignalServer(uvicorn.Server):\n    def install_signal_handlers(self):\n        pass\n\n\nclass MetricsServer:\n    def __init__(self, settings: Settings):\n        self._settings = settings\n        self._app = self._get_app()\n\n    def _get_app(self):\n        app = FastAPI(debug=self._settings.debug)\n        app.add_route(self._settings.metrics_endpoint, handle_metrics)\n        return app\n\n    async def start(self):\n        cfg = self._get_config()\n        self._server = _NoSignalServer(cfg)\n\n        metrics_server = f\"http://{self._settings.host}:{self._settings.metrics_port}\"\n        logger.info(f\"Metrics server running on {metrics_server}\")\n        logger.info(\n            \"Prometheus scraping endpoint can be accessed on \"\n            f\"{metrics_server}{self._settings.metrics_endpoint}\"\n        )\n        await self._server.serve()\n\n    def _get_config(self):\n        kwargs = {}\n\n        if self._settings._custom_metrics_server_settings:\n            logger.warning(\n                \"REST custom configuration is out of support. Use as your own risk\"\n            )\n            kwargs.update(self._settings._custom_metrics_server_settings)\n\n        kwargs.update(\n            {\n                \"host\": self._settings.host,\n                \"port\": self._settings.metrics_port,\n                \"access_log\": self._settings.debug,\n            }\n        )\n\n        # TODO: we want to disable logger unless debug is enabled (otherwise,\n        # prom reqs can be spammy)\n        return uvicorn.Config(self._app, **kwargs)\n\n    async def stop(self, sig: Optional[int] = None):\n        self._server.handle_exit(sig=sig, frame=None)\n", "path": "mlserver/metrics/server.py"}], "after_files": [{"content": "import uvicorn\n\nfrom fastapi import FastAPI\nfrom starlette_exporter import handle_metrics\n\nfrom ..settings import Settings\nfrom .logging import logger\nfrom typing import Optional\n\n\nclass _NoSignalServer(uvicorn.Server):\n    def install_signal_handlers(self):\n        pass\n\n\nclass MetricsServer:\n    def __init__(self, settings: Settings):\n        self._settings = settings\n        self._app = self._get_app()\n\n    def _get_app(self):\n        app = FastAPI(debug=self._settings.debug)\n        app.add_route(self._settings.metrics_endpoint, handle_metrics)\n        return app\n\n    async def start(self):\n        cfg = self._get_config()\n        self._server = _NoSignalServer(cfg)\n\n        metrics_server = f\"http://{self._settings.host}:{self._settings.metrics_port}\"\n        logger.info(f\"Metrics server running on {metrics_server}\")\n        logger.info(\n            \"Prometheus scraping endpoint can be accessed on \"\n            f\"{metrics_server}{self._settings.metrics_endpoint}\"\n        )\n        await self._server.serve()\n\n    def _get_config(self):\n        kwargs = {}\n\n        if self._settings._custom_metrics_server_settings:\n            logger.warning(\n                \"REST custom configuration is out of support. Use as your own risk\"\n            )\n            kwargs.update(self._settings._custom_metrics_server_settings)\n\n        kwargs.update(\n            {\n                \"host\": self._settings.host,\n                \"port\": self._settings.metrics_port,\n                \"access_log\": self._settings.debug,\n            }\n        )\n\n        if self._settings.logging_settings:\n            # If not None, use ours. Otherwise, let Uvicorn fall back on its\n            # own config.\n            kwargs.update({\"log_config\": self._settings.logging_settings})\n\n        return uvicorn.Config(self._app, **kwargs)\n\n    async def stop(self, sig: Optional[int] = None):\n        self._server.handle_exit(sig=sig, frame=None)\n", "path": "mlserver/metrics/server.py"}]}