Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions vllm/entrypoints/serve/utils/server_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,27 @@ def get_uvicorn_log_config(args: Namespace) -> dict | None:

Priority:
1. If log_config_file is specified, use it
2. If disable_access_log_for_endpoints is specified, create a config with
the access log filter
3. Otherwise, return None (use uvicorn defaults)
2. Otherwise, create a config (with optional endpoint filtering) that
includes timestamps in access logs to match other vLLM log lines.
"""
# First, try to load from file if specified
log_config = load_log_config(args.log_config_file)
if log_config is not None:
return log_config

# If endpoints to filter are specified, create a config with the filter
if args.disable_access_log_for_endpoints:
from vllm.logging_utils import create_uvicorn_log_config
from vllm.logging_utils import create_uvicorn_log_config

# Parse comma-separated string into list
excluded_paths = []
if args.disable_access_log_for_endpoints:
excluded_paths = [
p.strip()
for p in args.disable_access_log_for_endpoints.split(",")
if p.strip()
]
return create_uvicorn_log_config(
excluded_paths=excluded_paths,
log_level=args.uvicorn_log_level,
)

return None
return create_uvicorn_log_config(
excluded_paths=excluded_paths,
log_level=args.uvicorn_log_level,
)


def _extract_content_from_chunk(chunk_data: dict) -> str:
Expand Down
3 changes: 2 additions & 1 deletion vllm/logging_utils/access_log_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def create_uvicorn_log_config(
},
"access": {
"()": "uvicorn.logging.AccessFormatter",
"fmt": '%(levelprefix)s %(client_addr)s - "%(request_line)s" %(status_code)s', # noqa: E501
"fmt": '%(levelprefix)s %(asctime)s %(client_addr)s - "%(request_line)s" %(status_code)s', # noqa: E501
"datefmt": "%m-%d %H:%M:%S",
},
},
"handlers": {
Expand Down
Loading