From 12f8c03a9fab37efc0ac70d5382921cb898b3576 Mon Sep 17 00:00:00 2001 From: lxcxjxhx Date: Thu, 30 Jul 2026 21:01:47 +0800 Subject: [PATCH] fix: replace printStackTrace with RecordLog in ConfigUtil --- .../java/com/alibaba/csp/sentinel/util/ConfigUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/ConfigUtil.java b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/ConfigUtil.java index a5182b363e..591fb9fe0b 100644 --- a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/ConfigUtil.java +++ b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/util/ConfigUtil.java @@ -27,6 +27,8 @@ import java.util.List; import java.util.Properties; +import com.alibaba.csp.sentinel.log.RecordLog; + /** *

* Util class for loading configuration from file or command arguments. @@ -75,7 +77,7 @@ private static Properties loadPropertiesFromAbsoluteFile(String fileName) { properties.load(bufferedReader); } } catch (Throwable e) { - e.printStackTrace(); + RecordLog.warn("Failed to load properties from absolute file: {}", fileName, e); } return properties; } @@ -102,7 +104,7 @@ private static Properties loadPropertiesFromClasspathFile(String fileName) { list.add(urls.nextElement()); } } catch (Throwable e) { - e.printStackTrace(); + RecordLog.warn("Failed to get resources from classpath: {}", fileName, e); } if (list.isEmpty()) { @@ -117,7 +119,7 @@ private static Properties loadPropertiesFromClasspathFile(String fileName) { p.load(bufferedReader); properties.putAll(p); } catch (Throwable e) { - e.printStackTrace(); + RecordLog.warn("Failed to load properties from URL: {}", url, e); } } return properties;