fix: fix proxy logging

This commit is contained in:
Krrish Dholakia 2024-01-20 18:22:45 -08:00
parent 6b8e6497f6
commit e2831e9c80
3 changed files with 5 additions and 3 deletions

View file

@ -52,4 +52,4 @@ RUN chmod +x entrypoint.sh
EXPOSE 4000/tcp
ENTRYPOINT ["litellm"]
CMD ["--port", "4000", "--config", "./proxy_server_config.yaml", "--debug"]
CMD ["--port", "4000", "--config", "./proxy_server_config.yaml", "--detailed_debug"]

View file

@ -1309,7 +1309,6 @@ async def initialize(
verbose_logger.setLevel(level=logging.DEBUG) # set package log to debug
verbose_router_logger.setLevel(level=logging.DEBUG) # set router logs to debug
verbose_proxy_logger.setLevel(level=logging.DEBUG) # set proxy logs to debug
litellm.set_verbose = True
elif debug == False and detailed_debug == False:
# users can control proxy debugging using env variable = 'LITELLM_LOG'
litellm_log_setting = os.environ.get("LITELLM_LOG", "")

View file

@ -1084,7 +1084,7 @@ class Logging:
def success_handler(
self, result=None, start_time=None, end_time=None, cache_hit=None, **kwargs
):
verbose_logger.info(f"Logging Details LiteLLM-Success Call")
verbose_logger.debug(f"Logging Details LiteLLM-Success Call")
# print(f"original response in success handler: {self.model_call_details['original_response']}")
try:
verbose_logger.debug(f"success callbacks: {litellm.success_callback}")
@ -1252,6 +1252,9 @@ class Logging:
kwargs[k] = v
# this only logs streaming once, complete_streaming_response exists i.e when stream ends
if self.stream:
verbose_logger.debug(
f"is complete_streaming_response in kwargs: {kwargs.get('complete_streaming_response', None)}"
)
if "complete_streaming_response" not in kwargs:
break
else: