Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance logging. #613

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Enhance logging. #613

merged 1 commit into from
Jan 22, 2025

Conversation

blkt
Copy link
Contributor

@blkt blkt commented Jan 16, 2025

This change adds line numbers to log messages, and synergizes with Copilot specific changes that make exception handling in some of the copilot pipeline more localized, making it easier to track down issues with the proxy. There's no fundamental change in business logic.

@blkt blkt self-assigned this Jan 16, 2025
@blkt blkt force-pushed the chore/enhance-logging-copilot branch from bcf1b70 to 1627c13 Compare January 16, 2025 13:22
@yrobla
Copy link
Contributor

yrobla commented Jan 17, 2025

I am open to opinion from other colleagues, but i was very used to set log-level=DEBUG to see litellm outpout, so i could see input/output that is sent to LLMs. With this change i cannot see them anymore. So we either improve our debug logs a bit more to include those outputs, or we should be able to set log levels to litellm to the same level as we pass by parameter

@jhrozek
Copy link
Contributor

jhrozek commented Jan 17, 2025

I am open to opinion from other colleagues, but i was very used to set log-level=DEBUG to see litellm outpout, so i could see input/output that is sent to LLMs. With this change i cannot see them anymore. So we either improve our debug logs a bit more to include those outputs, or we should be able to set log levels to litellm to the same level as we pass by parameter

+1 quite often I need to see what is it that we are sending. I don't know if we can tune litellm debug levels any further, but this is the kind of a request I like to see:

litellm_logging.py:624 -

POST Request Sent from LiteLLM:
curl -X POST \
https://api.openai.com/v1 \
-d '{'model': 'gpt-4o', 'messages': [{'role': 'system', 'content': 'Act as an expert software developer.\nAlways use best practices when coding.\nRespect and use existing conventions, libr
aries, etc that are already present in the code base.\nYou are diligent and tireless!\nYou NEVER leave comments describing code without implementing it!\nYou always COMPLETELY IMPLEMENT th

I don't care about these:

2025-01-17T08:03:02.158927Z [debug    ] Logging Details LiteLLM-Success Call: Cache_hit=False module=litellm_logging pathname=/Users/jakub/devel/codegate/venv/lib/python3.12/site-packages/litellm/litellm_core_utils/litellm_logging.py

But I'd rather have them than not have any. I wonder if there would be a compromise to set them as another log level (trace or libs or whatnot)?

@lukehinds
Copy link
Contributor

we should be able to bring the others loggers in , i planned on making it so you could configure what other loggers are allowed in, this way you can switch off stuff like asyncio that is really loud when coupled with sqlalchemy

I had old branch I never completed work on, where I did something like this to make it configurable:

# Configure logger levels for different components
    for logger_name, level in logger_levels.items():
        logger = logging.getLogger(logger_name)
        logger.setLevel(level)
        logger.propagate = True

    # Default logger levels if not specified
    if "uvicorn" not in logger_levels:
        logging.getLogger("uvicorn").setLevel(log_level.value)
    if "sqlalchemy" not in logger_levels:
        logging.getLogger("sqlalchemy").setLevel(log_level.value)
    if "asyncio" not in logger_levels:
        logging.getLogger("asyncio").setLevel(log_level.value)

@blkt blkt force-pushed the chore/enhance-logging-copilot branch 2 times, most recently from f75942e to a499aec Compare January 17, 2025 11:49
This change adds line numbers to log messages, and synergizes with
Copilot specific changes that make exception handling in some of the
copilot pipeline more localized, making it easier to track down issues
with the proxy. There's no fundamental change in business logic.
@blkt blkt force-pushed the chore/enhance-logging-copilot branch from a499aec to 230c2fb Compare January 17, 2025 15:32
@lukehinds lukehinds self-requested a review January 20, 2025 14:46
@blkt blkt merged commit 2bda6c8 into main Jan 22, 2025
3 checks passed
@blkt blkt deleted the chore/enhance-logging-copilot branch January 22, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants