Skip to content

Commit 57a26be

Browse files
committed
[fix](fe-log) add position info in async mode apache#39419
1 parent fb17f20 commit 57a26be

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
@@ -70,13 +70,13 @@ public class Config extends ConfigBase {
7070
@ConfField(description = {"FE 日志的级别", "The level of FE log"}, options = {"INFO", "WARN", "ERROR", "FATAL"})
7171
public static String sys_log_level = "INFO";
7272

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

8282
@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)