feat(logger): set diagnose=False to prevent exposing secrets in Loguru traceback logs

Signed-off-by: 辰言 <oncwnuIWp30GguOyJ615Fqj8H-yc@git.weixin.qq.com>
This commit is contained in:
辰言 2026-07-06 09:23:38 +08:00
parent 10724d057a
commit e2a96c0822

View file

@ -178,6 +178,7 @@ def start_logger():
_json_sink,
level=GLOBAL_LOG_LEVEL,
filter=audit_filter,
diagnose=False,
)
else:
logger.add(
@ -185,6 +186,7 @@ def start_logger():
level=GLOBAL_LOG_LEVEL,
format=stdout_format,
filter=audit_filter,
diagnose=False,
)
if AUDIT_LOG_LEVEL != 'NONE' and ENABLE_AUDIT_LOGS_FILE:
try:
@ -195,6 +197,7 @@ def start_logger():
compression='zip',
format=file_format,
filter=lambda record: record['extra'].get('auditable') is True,
diagnose=False,
)
except Exception as e:
logger.error(f'Failed to initialize audit log file handler: {str(e)}')