Skip to content

Commit 2bdff39

Browse files
authored
[fix](fe-log) add position info in async mode (#39419)
followup #37793 NORMAL: sync flush + with location ASYNC(default): async flush + with location BRIEF: async flush + without location
1 parent 3a47732 commit 2bdff39

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

fe/fe-common/src/main/java/org/apache/doris/common/Config.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ public class Config extends ConfigBase {
7272
@ConfField(description = {"FE 日志的级别", "The level of FE log"}, options = {"INFO", "WARN", "ERROR", "FATAL"})
7373
public static String sys_log_level = "INFO";
7474

75-
@ConfField(description = {"FE 日志的输出模式,其中 NORMAL 模式是日志同步输出且包含位置信息,BRIEF 模式是日志同步输出"
76-
+ "但不包含位置信息,ASYNC 模式为默认的输出模式,是日志异步输出且不包含位置信息,三种日志输出模式的性能依次递增",
77-
"The output mode of FE log, and NORMAL mode means the logs are synchronized and contain location "
78-
+ "information. BRIEF mode is synchronized and does not contain location information. "
79-
+ "ASYNC mode is the default output mode, which is asynchronous and does not contain "
80-
+ "location information. The performance of the three log output modes increases in sequence"},
81-
options = {"NORMAL", "BRIEF", "ASYNC"})
75+
@ConfField(description = {"FE 日志的输出模式,其中 NORMAL 模式是日志同步输出且包含位置信息;ASYNC 模式为默认模式,日志异步输出"
76+
+ "且包含位置信息;BRIEF 是日志异步输出但不包含位置信息,三种日志输出模式的性能依次递增",
77+
"The output mode of FE log. NORMAL mode is synchronous output with location information; "
78+
+ "ASYNC mode is the default mode, asynchronous output with location information; "
79+
+ "BRIEF is asynchronous output without location information. "
80+
+ "The performance of the three log output modes increases in turn"},
81+
options = {"NORMAL", "ASYNC", "BRIEF"})
8282
public static String sys_log_mode = "ASYNC";
8383

8484
@ConfField(description = {"FE 日志文件的最大数量。超过这个数量后,最老的日志文件会被删除",

fe/fe-core/src/main/java/org/apache/doris/common/Log4jConfig.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,13 @@ private static void reconfig() throws IOException {
298298
properties.put("warn_sys_accumulated_file_size", String.valueOf(Config.warn_sys_accumulated_file_size));
299299
properties.put("audit_sys_accumulated_file_size", String.valueOf(Config.audit_sys_accumulated_file_size));
300300

301-
properties.put("include_location_flag", sysLogMode.equalsIgnoreCase("NORMAL") ? "true" : "false");
302-
properties.put("immediate_flush_flag", sysLogMode.equalsIgnoreCase("ASYNC") ? "false" : "true");
301+
// BRIEF: async, no location
302+
// ASYNC: async, with location
303+
// NORMAL: sync, with location
304+
boolean includeLocation = !sysLogMode.equalsIgnoreCase("BRIEF");
305+
boolean immediateFlush = sysLogMode.equalsIgnoreCase("NORMAL");
306+
properties.put("include_location_flag", Boolean.toString(includeLocation));
307+
properties.put("immediate_flush_flag", Boolean.toString(immediateFlush));
303308
properties.put("audit_file_postfix", compressAuditLog ? ".gz" : "");
304309

305310
strSub = new StrSubstitutor(new Interpolator(properties));

0 commit comments

Comments
 (0)