litellm - 💡(How to fix) Fix [Bug]: Logs are not recorded when using Claude Code CLI or streaming /v1/messagesHTTP requests [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#24794Fetched 2026-04-08 01:53:54
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When using the Claude Code CLI, log output is not being recorded. The same issue occurs when making an HTTP request to the /v1/messagesendpoint with stream: true; no logs are recorded for these streaming requests. Steps to Reproduce

Steps to Reproduce

Run a command with the Claude Code CLI that is expected to produce logs. Make an HTTP POST request to /v1/messageswith stream: true. Check the log files or logging system.

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.6

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To address the issue of log output not being recorded when using the Claude Code CLI or making an HTTP request to the /v1/messages endpoint with stream: true, we need to modify the logging configuration.

  • Update the logging configuration to include the stream logs.
  • Ensure that the logging level is set to an appropriate level (e.g., DEBUG or INFO) to capture the desired log output.

Example Code

Here's an example of how you can modify the logging configuration in Python:

import logging

# Set the logging level to DEBUG
logging.basicConfig(level=logging.DEBUG)

# Create a logger
logger = logging.getLogger(__name__)

# Log messages
logger.debug('This is a debug message')
logger.info('This is an info message')

# When making an HTTP request to the /v1/messages endpoint with stream: true
def handle_stream_request():
    # Log the request
    logger.info('Handling stream request')

    # Process the request
    # ...

    # Log the response
    logger.info('Stream request completed')

In the case of the Claude Code CLI, you may need to update the logging configuration in the CLI's configuration file or through a command-line flag.

Verification

To verify that the fix worked, you can:

  • Run the command with the Claude Code CLI that is expected to produce logs.
  • Make an HTTP POST request to /v1/messages with stream: true.
  • Check the log files or logging system to ensure that the log output is being recorded.

Extra Tips

  • Ensure that the logging configuration is properly updated and applied to the relevant components.
  • Test the logging configuration with different logging levels (e.g., DEBUG, INFO, WARNING, ERROR) to ensure that the desired log output is being captured.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: Logs are not recorded when using Claude Code CLI or streaming /v1/messagesHTTP requests [1 participants]