From a1ba6c9fa643c04492d274b2a664d2de88ce1603 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Tue, 3 Mar 2026 10:21:31 -0800 Subject: [PATCH] Fix log levels: info for unconfigured, warning for misconfigured Suppress noisy error log fired every cron tick when spend log cleanup is simply not configured. _should_delete_spend_logs already logs the specific reason at the right level (info for None, warning for invalid value), so the redundant blanket error log in cleanup_old_spend_logs is removed. Co-Authored-By: Claude Sonnet 4.6 --- litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py b/litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py index 6db7d6dd43..a538e411b6 100644 --- a/litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py +++ b/litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py @@ -60,7 +60,7 @@ class SpendLogCleanup: ) return True except ValueError as e: - verbose_proxy_logger.error( + verbose_proxy_logger.warning( f"Invalid maximum_spend_logs_retention_period value: {retention_setting}, error: {str(e)}" ) return False @@ -121,9 +121,6 @@ class SpendLogCleanup: verbose_proxy_logger.info(f"Cleanup job triggered at {datetime.now()}") if not self._should_delete_spend_logs(): - verbose_proxy_logger.error( - "Skipping cleanup — invalid or missing retention setting." - ) return if self.retention_seconds is None: