Skip to content

Conversation

@aitsvet
Copy link
Contributor

@aitsvet aitsvet commented Oct 13, 2025

Purpose

Split the logger.info call in vllm/entrypoints/logger.py to differentiate between verbose prompt-related details and essential request parameters.

This change moves request_id, prompt, prompt_token_ids, and prompt_embeds to a new logger.debug call. The original logger.info now only contains params and lora_request. This improves log clarity by:

  • Reducing log noise at the INFO level in production environments.
  • Providing detailed prompt information only when debug logging is enabled.

Test Plan

  1. Run existing unit and integration tests to ensure no regressions.
  2. Enable debug logging and verify that prompt-related information (request_id, prompt, prompt_token_ids, prompt_embeds) is correctly logged at the DEBUG level.
  3. With default info-level logging, verify that only params and lora_request are logged by the logger.info call.

Test Result

  • The logger.info call in vllm/entrypoints/logger.py has been split.
  • Prompt-related fields (request_id, prompt, prompt_token_ids, prompt_embeds) are now logged via logger.debug.
  • Essential request parameters (params, lora_request) remain in the logger.info call.
  • No functional changes or regressions are expected.

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves logging by separating verbose prompt details into a DEBUG level log, which is a good change for reducing log noise in production. My review includes a suggestion to further improve log clarity by making the new DEBUG log message more distinct from the INFO message, avoiding redundancy.

Comment on lines 37 to 45
logger.debug(
"Received request %s: prompt: %r, "
"params: %s, prompt_token_ids: %s, "
"prompt_embeds shape: %s, "
"lora_request: %s.",
"prompt_token_ids: %s, "
"prompt_embeds shape: %s.",
request_id,
prompt,
params,
prompt_token_ids,
prompt_embeds.shape if prompt_embeds is not None else None,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The log message prefix "Received request %s" is duplicated in both the DEBUG and INFO level logs. This is redundant and can make logs harder to read when debugging, as two lines for the same request will start with the same text. To improve log clarity, the DEBUG log message should be distinct to indicate it provides supplementary details for the request announced in the INFO log.

Suggested change
logger.debug(
"Received request %s: prompt: %r, "
"params: %s, prompt_token_ids: %s, "
"prompt_embeds shape: %s, "
"lora_request: %s.",
"prompt_token_ids: %s, "
"prompt_embeds shape: %s.",
request_id,
prompt,
params,
prompt_token_ids,
prompt_embeds.shape if prompt_embeds is not None else None,
)
logger.debug(
"Request %s details: prompt: %r, "
"prompt_token_ids: %s, "
"prompt_embeds shape: %s.",
request_id,
prompt,
prompt_token_ids,
prompt_embeds.shape if prompt_embeds is not None else None,
)

@aitsvet
Copy link
Contributor Author

aitsvet commented Oct 13, 2025

markmc commented

I think we should avoid a proliferation of magic environment variables like this

Unconditionally changing the default behaviour seems reasonable to me - basically, reducing the info level detail, and adding more detail at debug level

(Note for reviewers - this already requires --enable-log-requests, it's not on by default)

[Frontend] Add request arrival log #26685

Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks

@vllm-bot vllm-bot merged commit 5c7fe25 into vllm-project:main Oct 13, 2025
4 of 5 checks passed
1994 pushed a commit to 1994/vllm that referenced this pull request Oct 14, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: 1994 <1994@users.noreply.github.com>
Dhruvilbhatt pushed a commit to Dhruvilbhatt/vllm that referenced this pull request Oct 14, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: Dhruvil Bhatt <bhattdbh@amazon.com>
bbartels pushed a commit to bbartels/vllm that referenced this pull request Oct 16, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: bbartels <benjamin@bartels.dev>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Zhathw pushed a commit to Zhathw/vllm that referenced this pull request Nov 12, 2025
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants