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;