Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Add configurable LiteLLM logging control 🙉#722

Closed
lukehinds wants to merge 6 commits intomainfrom
litellm-shutup
Closed

Add configurable LiteLLM logging control 🙉#722
lukehinds wants to merge 6 commits intomainfrom
litellm-shutup

Conversation

@lukehinds
Copy link

Add configurable LiteLLM logging control 🙉

I could not take the noise anymore!

Add the ability to control LiteLLM logging through configuration:
- Add --enable-litellm CLI flag
- Add CODEGATE_ENABLE_LITELLM environment variable
- Add external_loggers.litellm config file option
- Set logger level to CRITICAL+1 when disabled to suppress all logging
- Update documentation with new logging configuration options

This change allows users to enable LiteLLM debug logging when needed while keeping it disabled by default to reduce noise.

I could not take the noise anymore

Add the ability to control LiteLLM logging through configuration:
- Add --enable-litellm CLI flag
- Add CODEGATE_ENABLE_LITELLM environment variable
- Add external_loggers.litellm config file option
- Set logger level to CRITICAL+1 when disabled to suppress all logging
- Update documentation with new logging configuration options

This change allows users to enable LiteLLM debug logging when needed
while keeping it disabled by default to reduce noise.
@lukehinds lukehinds changed the title Add configurable LiteLLM logging control 🙉 [WIP] Add configurable LiteLLM logging control 🙉 Jan 22, 2025
@lukehinds
Copy link
Author

we could add flags for sqlalchemy, asyncio etc, but I did not want to spend too much time on this and get back to PII

@lukehinds lukehinds changed the title [WIP] Add configurable LiteLLM logging control 🙉 Add configurable LiteLLM logging control 🙉 Jan 22, 2025
blkt
blkt previously approved these changes Jan 23, 2025
Comment on lines +249 to +254
@click.option(
"--enable-litellm",
is_flag=True,
default=False,
help="Enable LiteLLM logging (includes LiteLLM Proxy, Router, and core)",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not a big deal, but this feels like a cosmetic change rather than a functional one, only relevant for developers. For example, removing litellm would make this option useless, and removing it would be a breaking change.

I would avoid exposing this to the end user with an additional option, and rather only rely on environment variables.

Copy link
Author

Choose a reason for hiding this comment

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

Very good point! I will make the change.

- `CODEGATE_ENABLE_LITELLM`: enable LiteLLM logging
- `CODEGATE_ENABLE_SQLALCHEMY`: enable SQLAlchemy logging
- `CODEGATE_ENABLE_UVICORN_ERROR`: enable Uvicorn error logging
- `CODEGATE_ENABLE_AIOSQLITE`: enable aiosqlite logging
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably want to add the word "logging" to these environment variables. Else, it hints at enabling us disabling a whole component

@lukehinds
Copy link
Author

going to close and wait for the work @blkt is doing

@lukehinds lukehinds closed this Feb 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants