Reduce the noise from loggers (#8833)

This commit is contained in:
tofarr
2025-06-02 08:34:29 -06:00
committed by GitHub
parent 4221ce8566
commit 3f412027ec

View File

@@ -385,11 +385,23 @@ if LOG_TO_FILE:
) # default log to project root
openhands_logger.debug(f'Logging to file in: {LOG_DIR}')
# Exclude LiteLLM from logging output
# Exclude LiteLLM from logging output as it can leak keys
logging.getLogger('LiteLLM').disabled = True
logging.getLogger('LiteLLM Router').disabled = True
logging.getLogger('LiteLLM Proxy').disabled = True
# Exclude loquacious loggers
LOQUACIOUS_LOGGERS = [
'engineio',
'engineio.server',
'socketio',
'socketio.client',
'socketio.server',
]
for logger_name in LOQUACIOUS_LOGGERS:
logging.getLogger(logger_name).setLevel('WARNING')
class LlmFileHandler(logging.FileHandler):
"""LLM prompt and response logging."""