diff --git a/fe/fe-core/src/main/java/com/starrocks/common/Config.java b/fe/fe-core/src/main/java/com/starrocks/common/Config.java index ce0bbbcba62da..81bc8b27fcaf8 100644 --- a/fe/fe-core/src/main/java/com/starrocks/common/Config.java +++ b/fe/fe-core/src/main/java/com/starrocks/common/Config.java @@ -2479,8 +2479,20 @@ public class Config extends ConfigBase { @ConfField(mutable = true) public static boolean enable_collect_query_detail_info = false; + //============================== Plan Feature Extraction BEGIN ========================================// @ConfField(mutable = true, comment = "Collect features of query plan into a log file") public static boolean enable_plan_feature_collection = false; + @ConfField + public static String feature_log_dir = StarRocksFE.STARROCKS_HOME_DIR + "/log"; + @ConfField + public static String feature_log_roll_interval = "DAY"; + @ConfField + public static String feature_log_delete_age = "3d"; + @ConfField + public static int feature_log_roll_num = 5; + @ConfField + public static int feature_log_roll_size_mb = 1024; // 1 GB in MB + //============================== Plan Feature Extraction END ========================================// @ConfField(mutable = true, comment = "Enable the sql digest feature, building a parameterized digest for each sql in the query detail") diff --git a/fe/fe-core/src/main/java/com/starrocks/common/Log4jConfig.java b/fe/fe-core/src/main/java/com/starrocks/common/Log4jConfig.java index fecbcfdd686c9..5a1023767bf53 100644 --- a/fe/fe-core/src/main/java/com/starrocks/common/Log4jConfig.java +++ b/fe/fe-core/src/main/java/com/starrocks/common/Log4jConfig.java @@ -145,16 +145,16 @@ public class Log4jConfig extends XmlConfiguration { " \n" + " \n" + + " filePattern=\"${profile_log_dir}/fe.features.log.${feature_file_pattern}-%i\">\n" + " ${syslog_profile_layout}\n" + " \n" + " \n" + - " \n" + + " \n" + " \n" + - " \n" + - " \n" + + " \n" + + " \n" + " \n" + - " \n" + + " \n" + " \n" + " \n" + " \n" + @@ -272,6 +272,14 @@ static String generateActiveLog4jXmlConfig() throws IOException { properties.put("profile_file_pattern", getIntervalPattern("profile_log_roll_interval", Config.profile_log_roll_interval)); + // feature log config + properties.put("feature_log_dir", Config.feature_log_dir); + properties.put("feature_log_roll_size_mb", String.valueOf(Config.feature_log_roll_size_mb)); + properties.put("feature_log_roll_num", String.valueOf(Config.feature_log_roll_num)); + properties.put("feature_log_delete_age", String.valueOf(Config.feature_log_delete_age)); + properties.put("feature_file_pattern", + getIntervalPattern("feature_log_roll_interval", Config.feature_log_roll_interval)); + // internal log config properties.put("internal_log_dir", Config.internal_log_dir); properties.put("internal_roll_maxsize", String.valueOf(Config.log_roll_size_mb));