diff --git a/vllm/entrypoints/serve/utils/server_utils.py b/vllm/entrypoints/serve/utils/server_utils.py index d24d492b61ed..2c39fad1f313 100644 --- a/vllm/entrypoints/serve/utils/server_utils.py +++ b/vllm/entrypoints/serve/utils/server_utils.py @@ -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: diff --git a/vllm/logging_utils/access_log_filter.py b/vllm/logging_utils/access_log_filter.py index 5501bd5bc6e8..8a999b8589de 100644 --- a/vllm/logging_utils/access_log_filter.py +++ b/vllm/logging_utils/access_log_filter.py @@ -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": {