Skip to content

Commit 3f41202

Browse files
authored
Reduce the noise from loggers (#8833)
1 parent 4221ce8 commit 3f41202

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

openhands/core/logger.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,23 @@ def log_uncaught_exceptions(
385385
) # default log to project root
386386
openhands_logger.debug(f'Logging to file in: {LOG_DIR}')
387387

388-
# Exclude LiteLLM from logging output
388+
# Exclude LiteLLM from logging output as it can leak keys
389389
logging.getLogger('LiteLLM').disabled = True
390390
logging.getLogger('LiteLLM Router').disabled = True
391391
logging.getLogger('LiteLLM Proxy').disabled = True
392392

393+
# Exclude loquacious loggers
394+
LOQUACIOUS_LOGGERS = [
395+
'engineio',
396+
'engineio.server',
397+
'socketio',
398+
'socketio.client',
399+
'socketio.server',
400+
]
401+
402+
for logger_name in LOQUACIOUS_LOGGERS:
403+
logging.getLogger(logger_name).setLevel('WARNING')
404+
393405

394406
class LlmFileHandler(logging.FileHandler):
395407
"""LLM prompt and response logging."""

0 commit comments

Comments
 (0)