prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Enhancement: Support dictConfig in picologging
  `picologging` will implement a `dictConfig` with the following PR: https://github.com/microsoft/picologging/issues/53
  
  We should enhance our integration to call this method once it's officially released.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `starlite/logging/__init__.py`
  Content:
  ```
  1 from logging import config
  2 from typing import Any, Dict, List, Optional, Union
  3 
  4 from pydantic import BaseModel
  5 from typing_extensions import Literal
  6 
  7 from starlite.logging.standard import QueueListenerHandler
  8 
  9 __all__ = ["LoggingConfig", "QueueListenerHandler"]
  10 
  11 
  12 class LoggingConfig(BaseModel):
  13     """Convenience `pydantic` model for configuring logging.
  14 
  15     For detailed instructions consult [standard library docs](https://docs.python.org/3/library/logging.config.html).
  16     """
  17 
  18     version: Literal[1] = 1
  19     """The only valid value at present is 1."""
  20     incremental: bool = False
  21     """Whether the configuration is to be interpreted as incremental to the existing configuration. """
  22     disable_existing_loggers: bool = False
  23     """Whether any existing non-root loggers are to be disabled."""
  24     filters: Optional[Dict[str, Dict[str, Any]]] = None
  25     """A dict in which each key is a filter id and each value is a dict describing how to configure the corresponding Filter instance."""
  26     propagate: bool = True
  27     """If messages must propagate to handlers higher up the logger hierarchy from this logger."""
  28     formatters: Dict[str, Dict[str, Any]] = {
  29         "standard": {"format": "%(levelname)s - %(asctime)s - %(name)s - %(module)s - %(message)s"}
  30     }
  31     handlers: Dict[str, Dict[str, Any]] = {
  32         "console": {
  33             "class": "logging.StreamHandler",
  34             "level": "DEBUG",
  35             "formatter": "standard",
  36         },
  37         "queue_listener": {"class": "starlite.QueueListenerHandler", "handlers": ["cfg://handlers.console"]},
  38     }
  39     """A dict in which each key is a handler id and each value is a dict describing how to configure the corresponding Handler instance."""
  40     loggers: Dict[str, Dict[str, Any]] = {
  41         "starlite": {
  42             "level": "INFO",
  43             "handlers": ["queue_listener"],
  44         },
  45     }
  46     """A dict in which each key is a logger name and each value is a dict describing how to configure the corresponding Logger instance."""
  47     root: Dict[str, Union[Dict[str, Any], List[Any], str]] = {"handlers": ["queue_listener"], "level": "INFO"}
  48     """This will be the configuration for the root logger. Processing of the configuration will be as for any logger,
  49     except that the propagate setting will not be applicable."""
  50 
  51     def configure(self) -> None:
  52         """Configured logger with the given configuration."""
  53         config.dictConfig(self.dict(exclude_none=True))
  54
  ```
  
  Path: `starlite/logging/picologging.py`
  Content:
  ```
  1 from queue import Queue
  2 from typing import Any, List
  3 
  4 from picologging.handlers import QueueHandler, QueueListener
  5 
  6 from starlite.logging.standard import resolve_handlers
  7 
  8 
  9 class QueueListenerHandler(QueueHandler):  # type: ignore
  10     def __init__(self, handlers: List[Any], respect_handler_level: bool = False, queue: Queue = Queue(-1)):
  11         """Configures queue listener and handler to support non-blocking
  12         logging configuration.
  13 
  14         Requires `picologging`, install with:
  15         ```shell
  16         $ pip install starlite[picologging]
  17         ```
  18 
  19         Args:
  20             handlers (list): list of handler names.
  21             respect_handler_level (bool): A handler’s level is respected (compared with the level for the message) when
  22                 deciding whether to pass messages to that handler.
  23         """
  24         super().__init__(queue)
  25         self.handlers = resolve_handlers(handlers)
  26         self._listener: QueueListener = QueueListener(
  27             self.queue, *self.handlers, respect_handler_level=respect_handler_level
  28         )
  29         self._listener.start()
  30
  ```
  
  Path: `starlite/logging/standard.py`
  Content:
  ```
  1 from logging.handlers import QueueHandler, QueueListener
  2 from queue import Queue
  3 from typing import Any, List
  4 
  5 
  6 class QueueListenerHandler(QueueHandler):
  7     """Configures queue listener and handler to support non-blocking logging
  8     configuration."""
  9 
  10     def __init__(self, handlers: List[Any], respect_handler_level: bool = False, queue: Queue = Queue(-1)):
  11         """Configures queue listener and handler to support non-blocking
  12         logging configuration.
  13 
  14         Args:
  15             handlers (list): list of handler names.
  16             respect_handler_level (bool): A handler’s level is respected (compared with the level for the message) when
  17                 deciding whether to pass messages to that handler.
  18         """
  19         super().__init__(queue)
  20         self.handlers = resolve_handlers(handlers)
  21         self._listener: QueueListener = QueueListener(
  22             self.queue, *self.handlers, respect_handler_level=respect_handler_level
  23         )
  24         self._listener.start()
  25 
  26 
  27 def resolve_handlers(handlers: List[Any]) -> List[Any]:
  28     """Converts list of string of handlers to the object of respective handler.
  29 
  30     Indexing the list performs the evaluation of the object.
  31     """
  32     return [handlers[i] for i in range(len(handlers))]
  33
  ```
  --- 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/starlite/logging/__init__.py b/starlite/logging/__init__.py
  --- a/starlite/logging/__init__.py
  +++ b/starlite/logging/__init__.py
  @@ -1,11 +1,16 @@
   from logging import config
  -from typing import Any, Dict, List, Optional, Union
  +from typing import Any, Dict, Generator, Iterable, List, Optional, Union
   
   from pydantic import BaseModel
   from typing_extensions import Literal
   
   from starlite.logging.standard import QueueListenerHandler
   
  +try:
  +    from picologging import config as picologging_config
  +except ImportError:
  +    picologging_config = None
  +
   __all__ = ["LoggingConfig", "QueueListenerHandler"]
   
   
  @@ -49,5 +54,33 @@
       except that the propagate setting will not be applicable."""
   
       def configure(self) -> None:
  -        """Configured logger with the given configuration."""
  +        """Configured logger with the given configuration.
  +
  +        If the logger class contains the word `picologging`, we try to
  +        import and set the dictConfig
  +        """
  +        for logging_class in find_keys(self.handlers, "class"):
  +            if "picologging" in logging_class and picologging_config:
  +                picologging_config.dictConfig(self.dict(exclude_none=True))
  +                break
           config.dictConfig(self.dict(exclude_none=True))
  +
  +
  +def find_keys(node: Union[List, Dict], key: str) -> Generator[Iterable, None, None]:
  +    """Find Nested Keys with name
  +    Search a dictionary for the presence of key
  +    Args:
  +        node (Union[List, Dict]): a dictionary to search
  +        key (str): the dictionary key to find
  +
  +    Yields:
  +        Generator[Iterable, None, None]: Value of dictionary key
  +    """
  +    if isinstance(node, list):
  +        for list_entry in node:
  +            yield from find_keys(list_entry, key)
  +    elif isinstance(node, dict):
  +        if key in node:
  +            yield node[key]
  +        for dict_entry in node.values():
  +            yield from find_keys(dict_entry, key)
  diff --git a/starlite/logging/picologging.py b/starlite/logging/picologging.py
  --- a/starlite/logging/picologging.py
  +++ b/starlite/logging/picologging.py
  @@ -18,7 +18,7 @@
   
           Args:
               handlers (list): list of handler names.
  -            respect_handler_level (bool): A handler’s level is respected (compared with the level for the message) when
  +            respect_handler_level (bool): A handler's level is respected (compared with the level for the message) when
                   deciding whether to pass messages to that handler.
           """
           super().__init__(queue)
  diff --git a/starlite/logging/standard.py b/starlite/logging/standard.py
  --- a/starlite/logging/standard.py
  +++ b/starlite/logging/standard.py
  @@ -13,7 +13,7 @@
   
           Args:
               handlers (list): list of handler names.
  -            respect_handler_level (bool): A handler’s level is respected (compared with the level for the message) when
  +            respect_handler_level (bool): A handler's level is respected (compared with the level for the message) when
                   deciding whether to pass messages to that handler.
           """
           super().__init__(queue)
  
verification_info: {"golden_diff": "diff --git a/starlite/logging/__init__.py b/starlite/logging/__init__.py\n--- a/starlite/logging/__init__.py\n+++ b/starlite/logging/__init__.py\n@@ -1,11 +1,16 @@\n from logging import config\n-from typing import Any, Dict, List, Optional, Union\n+from typing import Any, Dict, Generator, Iterable, List, Optional, Union\n \n from pydantic import BaseModel\n from typing_extensions import Literal\n \n from starlite.logging.standard import QueueListenerHandler\n \n+try:\n+    from picologging import config as picologging_config\n+except ImportError:\n+    picologging_config = None\n+\n __all__ = [\"LoggingConfig\", \"QueueListenerHandler\"]\n \n \n@@ -49,5 +54,33 @@\n     except that the propagate setting will not be applicable.\"\"\"\n \n     def configure(self) -> None:\n-        \"\"\"Configured logger with the given configuration.\"\"\"\n+        \"\"\"Configured logger with the given configuration.\n+\n+        If the logger class contains the word `picologging`, we try to\n+        import and set the dictConfig\n+        \"\"\"\n+        for logging_class in find_keys(self.handlers, \"class\"):\n+            if \"picologging\" in logging_class and picologging_config:\n+                picologging_config.dictConfig(self.dict(exclude_none=True))\n+                break\n         config.dictConfig(self.dict(exclude_none=True))\n+\n+\n+def find_keys(node: Union[List, Dict], key: str) -> Generator[Iterable, None, None]:\n+    \"\"\"Find Nested Keys with name\n+    Search a dictionary for the presence of key\n+    Args:\n+        node (Union[List, Dict]): a dictionary to search\n+        key (str): the dictionary key to find\n+\n+    Yields:\n+        Generator[Iterable, None, None]: Value of dictionary key\n+    \"\"\"\n+    if isinstance(node, list):\n+        for list_entry in node:\n+            yield from find_keys(list_entry, key)\n+    elif isinstance(node, dict):\n+        if key in node:\n+            yield node[key]\n+        for dict_entry in node.values():\n+            yield from find_keys(dict_entry, key)\ndiff --git a/starlite/logging/picologging.py b/starlite/logging/picologging.py\n--- a/starlite/logging/picologging.py\n+++ b/starlite/logging/picologging.py\n@@ -18,7 +18,7 @@\n \n         Args:\n             handlers (list): list of handler names.\n-            respect_handler_level (bool): A handler\u2019s level is respected (compared with the level for the message) when\n+            respect_handler_level (bool): A handler's level is respected (compared with the level for the message) when\n                 deciding whether to pass messages to that handler.\n         \"\"\"\n         super().__init__(queue)\ndiff --git a/starlite/logging/standard.py b/starlite/logging/standard.py\n--- a/starlite/logging/standard.py\n+++ b/starlite/logging/standard.py\n@@ -13,7 +13,7 @@\n \n         Args:\n             handlers (list): list of handler names.\n-            respect_handler_level (bool): A handler\u2019s level is respected (compared with the level for the message) when\n+            respect_handler_level (bool): A handler's level is respected (compared with the level for the message) when\n                 deciding whether to pass messages to that handler.\n         \"\"\"\n         super().__init__(queue)\n", "issue": "Enhancement: Support dictConfig in picologging\n`picologging` will implement a `dictConfig` with the following PR: https://github.com/microsoft/picologging/issues/53\r\n\r\nWe should enhance our integration to call this method once it's officially released.\r\n\n", "before_files": [{"content": "from logging import config\nfrom typing import Any, Dict, List, Optional, Union\n\nfrom pydantic import BaseModel\nfrom typing_extensions import Literal\n\nfrom starlite.logging.standard import QueueListenerHandler\n\n__all__ = [\"LoggingConfig\", \"QueueListenerHandler\"]\n\n\nclass LoggingConfig(BaseModel):\n    \"\"\"Convenience `pydantic` model for configuring logging.\n\n    For detailed instructions consult [standard library docs](https://docs.python.org/3/library/logging.config.html).\n    \"\"\"\n\n    version: Literal[1] = 1\n    \"\"\"The only valid value at present is 1.\"\"\"\n    incremental: bool = False\n    \"\"\"Whether the configuration is to be interpreted as incremental to the existing configuration. \"\"\"\n    disable_existing_loggers: bool = False\n    \"\"\"Whether any existing non-root loggers are to be disabled.\"\"\"\n    filters: Optional[Dict[str, Dict[str, Any]]] = None\n    \"\"\"A dict in which each key is a filter id and each value is a dict describing how to configure the corresponding Filter instance.\"\"\"\n    propagate: bool = True\n    \"\"\"If messages must propagate to handlers higher up the logger hierarchy from this logger.\"\"\"\n    formatters: Dict[str, Dict[str, Any]] = {\n        \"standard\": {\"format\": \"%(levelname)s - %(asctime)s - %(name)s - %(module)s - %(message)s\"}\n    }\n    handlers: Dict[str, Dict[str, Any]] = {\n        \"console\": {\n            \"class\": \"logging.StreamHandler\",\n            \"level\": \"DEBUG\",\n            \"formatter\": \"standard\",\n        },\n        \"queue_listener\": {\"class\": \"starlite.QueueListenerHandler\", \"handlers\": [\"cfg://handlers.console\"]},\n    }\n    \"\"\"A dict in which each key is a handler id and each value is a dict describing how to configure the corresponding Handler instance.\"\"\"\n    loggers: Dict[str, Dict[str, Any]] = {\n        \"starlite\": {\n            \"level\": \"INFO\",\n            \"handlers\": [\"queue_listener\"],\n        },\n    }\n    \"\"\"A dict in which each key is a logger name and each value is a dict describing how to configure the corresponding Logger instance.\"\"\"\n    root: Dict[str, Union[Dict[str, Any], List[Any], str]] = {\"handlers\": [\"queue_listener\"], \"level\": \"INFO\"}\n    \"\"\"This will be the configuration for the root logger. Processing of the configuration will be as for any logger,\n    except that the propagate setting will not be applicable.\"\"\"\n\n    def configure(self) -> None:\n        \"\"\"Configured logger with the given configuration.\"\"\"\n        config.dictConfig(self.dict(exclude_none=True))\n", "path": "starlite/logging/__init__.py"}, {"content": "from queue import Queue\nfrom typing import Any, List\n\nfrom picologging.handlers import QueueHandler, QueueListener\n\nfrom starlite.logging.standard import resolve_handlers\n\n\nclass QueueListenerHandler(QueueHandler):  # type: ignore\n    def __init__(self, handlers: List[Any], respect_handler_level: bool = False, queue: Queue = Queue(-1)):\n        \"\"\"Configures queue listener and handler to support non-blocking\n        logging configuration.\n\n        Requires `picologging`, install with:\n        ```shell\n        $ pip install starlite[picologging]\n        ```\n\n        Args:\n            handlers (list): list of handler names.\n            respect_handler_level (bool): A handler\u2019s level is respected (compared with the level for the message) when\n                deciding whether to pass messages to that handler.\n        \"\"\"\n        super().__init__(queue)\n        self.handlers = resolve_handlers(handlers)\n        self._listener: QueueListener = QueueListener(\n            self.queue, *self.handlers, respect_handler_level=respect_handler_level\n        )\n        self._listener.start()\n", "path": "starlite/logging/picologging.py"}, {"content": "from logging.handlers import QueueHandler, QueueListener\nfrom queue import Queue\nfrom typing import Any, List\n\n\nclass QueueListenerHandler(QueueHandler):\n    \"\"\"Configures queue listener and handler to support non-blocking logging\n    configuration.\"\"\"\n\n    def __init__(self, handlers: List[Any], respect_handler_level: bool = False, queue: Queue = Queue(-1)):\n        \"\"\"Configures queue listener and handler to support non-blocking\n        logging configuration.\n\n        Args:\n            handlers (list): list of handler names.\n            respect_handler_level (bool): A handler\u2019s level is respected (compared with the level for the message) when\n                deciding whether to pass messages to that handler.\n        \"\"\"\n        super().__init__(queue)\n        self.handlers = resolve_handlers(handlers)\n        self._listener: QueueListener = QueueListener(\n            self.queue, *self.handlers, respect_handler_level=respect_handler_level\n        )\n        self._listener.start()\n\n\ndef resolve_handlers(handlers: List[Any]) -> List[Any]:\n    \"\"\"Converts list of string of handlers to the object of respective handler.\n\n    Indexing the list performs the evaluation of the object.\n    \"\"\"\n    return [handlers[i] for i in range(len(handlers))]\n", "path": "starlite/logging/standard.py"}], "after_files": [{"content": "from logging import config\nfrom typing import Any, Dict, Generator, Iterable, List, Optional, Union\n\nfrom pydantic import BaseModel\nfrom typing_extensions import Literal\n\nfrom starlite.logging.standard import QueueListenerHandler\n\ntry:\n    from picologging import config as picologging_config\nexcept ImportError:\n    picologging_config = None\n\n__all__ = [\"LoggingConfig\", \"QueueListenerHandler\"]\n\n\nclass LoggingConfig(BaseModel):\n    \"\"\"Convenience `pydantic` model for configuring logging.\n\n    For detailed instructions consult [standard library docs](https://docs.python.org/3/library/logging.config.html).\n    \"\"\"\n\n    version: Literal[1] = 1\n    \"\"\"The only valid value at present is 1.\"\"\"\n    incremental: bool = False\n    \"\"\"Whether the configuration is to be interpreted as incremental to the existing configuration. \"\"\"\n    disable_existing_loggers: bool = False\n    \"\"\"Whether any existing non-root loggers are to be disabled.\"\"\"\n    filters: Optional[Dict[str, Dict[str, Any]]] = None\n    \"\"\"A dict in which each key is a filter id and each value is a dict describing how to configure the corresponding Filter instance.\"\"\"\n    propagate: bool = True\n    \"\"\"If messages must propagate to handlers higher up the logger hierarchy from this logger.\"\"\"\n    formatters: Dict[str, Dict[str, Any]] = {\n        \"standard\": {\"format\": \"%(levelname)s - %(asctime)s - %(name)s - %(module)s - %(message)s\"}\n    }\n    handlers: Dict[str, Dict[str, Any]] = {\n        \"console\": {\n            \"class\": \"logging.StreamHandler\",\n            \"level\": \"DEBUG\",\n            \"formatter\": \"standard\",\n        },\n        \"queue_listener\": {\"class\": \"starlite.QueueListenerHandler\", \"handlers\": [\"cfg://handlers.console\"]},\n    }\n    \"\"\"A dict in which each key is a handler id and each value is a dict describing how to configure the corresponding Handler instance.\"\"\"\n    loggers: Dict[str, Dict[str, Any]] = {\n        \"starlite\": {\n            \"level\": \"INFO\",\n            \"handlers\": [\"queue_listener\"],\n        },\n    }\n    \"\"\"A dict in which each key is a logger name and each value is a dict describing how to configure the corresponding Logger instance.\"\"\"\n    root: Dict[str, Union[Dict[str, Any], List[Any], str]] = {\"handlers\": [\"queue_listener\"], \"level\": \"INFO\"}\n    \"\"\"This will be the configuration for the root logger. Processing of the configuration will be as for any logger,\n    except that the propagate setting will not be applicable.\"\"\"\n\n    def configure(self) -> None:\n        \"\"\"Configured logger with the given configuration.\n\n        If the logger class contains the word `picologging`, we try to\n        import and set the dictConfig\n        \"\"\"\n        for logging_class in find_keys(self.handlers, \"class\"):\n            if \"picologging\" in logging_class and picologging_config:\n                picologging_config.dictConfig(self.dict(exclude_none=True))\n                break\n        config.dictConfig(self.dict(exclude_none=True))\n\n\ndef find_keys(node: Union[List, Dict], key: str) -> Generator[Iterable, None, None]:\n    \"\"\"Find Nested Keys with name\n    Search a dictionary for the presence of key\n    Args:\n        node (Union[List, Dict]): a dictionary to search\n        key (str): the dictionary key to find\n\n    Yields:\n        Generator[Iterable, None, None]: Value of dictionary key\n    \"\"\"\n    if isinstance(node, list):\n        for list_entry in node:\n            yield from find_keys(list_entry, key)\n    elif isinstance(node, dict):\n        if key in node:\n            yield node[key]\n        for dict_entry in node.values():\n            yield from find_keys(dict_entry, key)\n", "path": "starlite/logging/__init__.py"}, {"content": "from queue import Queue\nfrom typing import Any, List\n\nfrom picologging.handlers import QueueHandler, QueueListener\n\nfrom starlite.logging.standard import resolve_handlers\n\n\nclass QueueListenerHandler(QueueHandler):  # type: ignore\n    def __init__(self, handlers: List[Any], respect_handler_level: bool = False, queue: Queue = Queue(-1)):\n        \"\"\"Configures queue listener and handler to support non-blocking\n        logging configuration.\n\n        Requires `picologging`, install with:\n        ```shell\n        $ pip install starlite[picologging]\n        ```\n\n        Args:\n            handlers (list): list of handler names.\n            respect_handler_level (bool): A handler's level is respected (compared with the level for the message) when\n                deciding whether to pass messages to that handler.\n        \"\"\"\n        super().__init__(queue)\n        self.handlers = resolve_handlers(handlers)\n        self._listener: QueueListener = QueueListener(\n            self.queue, *self.handlers, respect_handler_level=respect_handler_level\n        )\n        self._listener.start()\n", "path": "starlite/logging/picologging.py"}, {"content": "from logging.handlers import QueueHandler, QueueListener\nfrom queue import Queue\nfrom typing import Any, List\n\n\nclass QueueListenerHandler(QueueHandler):\n    \"\"\"Configures queue listener and handler to support non-blocking logging\n    configuration.\"\"\"\n\n    def __init__(self, handlers: List[Any], respect_handler_level: bool = False, queue: Queue = Queue(-1)):\n        \"\"\"Configures queue listener and handler to support non-blocking\n        logging configuration.\n\n        Args:\n            handlers (list): list of handler names.\n            respect_handler_level (bool): A handler's level is respected (compared with the level for the message) when\n                deciding whether to pass messages to that handler.\n        \"\"\"\n        super().__init__(queue)\n        self.handlers = resolve_handlers(handlers)\n        self._listener: QueueListener = QueueListener(\n            self.queue, *self.handlers, respect_handler_level=respect_handler_level\n        )\n        self._listener.start()\n\n\ndef resolve_handlers(handlers: List[Any]) -> List[Any]:\n    \"\"\"Converts list of string of handlers to the object of respective handler.\n\n    Indexing the list performs the evaluation of the object.\n    \"\"\"\n    return [handlers[i] for i in range(len(handlers))]\n", "path": "starlite/logging/standard.py"}]}