Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](fe-log) add position info in async mode #39419

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions fe/fe-common/src/main/java/org/apache/doris/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public class Config extends ConfigBase {
@ConfField(description = {"FE 日志的级别", "The level of FE log"}, options = {"INFO", "WARN", "ERROR", "FATAL"})
public static String sys_log_level = "INFO";

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

@ConfField(description = {"FE 日志文件的最大数量。超过这个数量后,最老的日志文件会被删除",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,13 @@ private static void reconfig() throws IOException {
properties.put("warn_sys_accumulated_file_size", String.valueOf(Config.warn_sys_accumulated_file_size));
properties.put("audit_sys_accumulated_file_size", String.valueOf(Config.audit_sys_accumulated_file_size));

properties.put("include_location_flag", sysLogMode.equalsIgnoreCase("NORMAL") ? "true" : "false");
properties.put("immediate_flush_flag", sysLogMode.equalsIgnoreCase("ASYNC") ? "false" : "true");
// BRIEF: async, no location
// ASYNC: async, with location
// NORMAL: sync, with location
boolean includeLocation = !sysLogMode.equalsIgnoreCase("BRIEF");
boolean immediateFlush = sysLogMode.equalsIgnoreCase("NORMAL");
properties.put("include_location_flag", Boolean.toString(includeLocation));
properties.put("immediate_flush_flag", Boolean.toString(immediateFlush));
properties.put("audit_file_postfix", compressAuditLog ? ".gz" : "");

strSub = new StrSubstitutor(new Interpolator(properties));
Expand Down
Loading