[Core] Fix broken log configuration (#10458)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2024-11-22 21:23:51 -05:00
committed by GitHub
parent 9195dbdbca
commit ebda51968b
2 changed files with 7 additions and 2 deletions

View File

@ -118,7 +118,7 @@ configuration for the root vLLM logger and for the logger you wish to silence:
{
"formatters": {
"vllm": {
"class": "vllm.logging.NewLineFormatter",
"class": "vllm.logging_utils.NewLineFormatter",
"datefmt": "%m-%d %H:%M:%S",
"format": "%(levelname)s %(asctime)s %(filename)s:%(lineno)d] %(message)s"
}

View File

@ -50,7 +50,7 @@ DEFAULT_LOGGING_CONFIG = {
def _configure_vllm_root_logger() -> None:
logging_config: Optional[Dict] = None
logging_config: Dict = {}
if not VLLM_CONFIGURE_LOGGING and VLLM_LOGGING_CONFIG_PATH:
raise RuntimeError(
@ -75,6 +75,11 @@ def _configure_vllm_root_logger() -> None:
type(custom_config).__name__)
logging_config = custom_config
for formatter in logging_config.get("formatters", {}).values():
# This provides backwards compatibility after #10134.
if formatter.get("class") == "vllm.logging.NewLineFormatter":
formatter["class"] = "vllm.logging_utils.NewLineFormatter"
if logging_config:
dictConfig(logging_config)