Skip to content

Commit

Permalink
[Core] Fix broken log configuration (vllm-project#10458)
Browse files Browse the repository at this point in the history
Signed-off-by: Russell Bryant <[email protected]>
Signed-off-by: Maxime Fournioux <[email protected]>
  • Loading branch information
russellb authored and mfournioux committed Nov 28, 2024
1 parent a032371 commit 18b6856
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/logging_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
7 changes: 6 additions & 1 deletion vllm/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@


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(
Expand All @@ -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)

Expand Down

0 comments on commit 18b6856

Please sign in to comment.