From 4c019bfb3d86831b56b89586e97abcfdb4df1187 Mon Sep 17 00:00:00 2001 From: doleyzi Date: Thu, 31 Oct 2024 18:14:06 +0800 Subject: [PATCH] [INLONG-11442][Audit] Optimize the exception log of Audit SDK --- .../java/org/apache/inlong/audit/send/SenderManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderManager.java b/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderManager.java index b795b7aa981..97f2baf33cc 100644 --- a/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderManager.java +++ b/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderManager.java @@ -77,15 +77,16 @@ public void closeSocket() { public boolean checkSocket() { if (socket.isClosed() || !socket.isConnected()) { + InetSocketAddress inetSocketAddress = null; try { - InetSocketAddress inetSocketAddress = ProxyManager.getInstance().getInetSocketAddress(); + inetSocketAddress = ProxyManager.getInstance().getInetSocketAddress(); if (inetSocketAddress == null) { LOGGER.error("Audit proxy address is null!"); return false; } reconnect(inetSocketAddress, auditConfig.getSocketTimeout()); } catch (IOException exception) { - LOGGER.error("Connect to audit proxy {} has exception!", socket.getInetAddress(), exception); + LOGGER.error("Connect to audit proxy {} has exception!", inetSocketAddress, exception); return false; } }