[feature](merge-cloud) Change fe log rolling max size (#32777)

This commit is contained in:
deardeng
2024-03-25 23:13:35 +08:00
committed by morningman
parent 4b5163c905
commit db3bbc2437
2 changed files with 18 additions and 3 deletions

View File

@ -60,7 +60,9 @@ public class Log4jConfig extends XmlConfiguration {
+ " <DefaultRolloverStrategy max=\"${sys_roll_num}\" fileIndex=\"max\">\n"
+ " <Delete basePath=\"${sys_log_dir}/\" maxDepth=\"1\">\n"
+ " <IfFileName glob=\"fe.log.*\" />\n"
+ " <IfLastModified age=\"${sys_log_delete_age}\" />\n"
+ " <IfAny>\n"
+ " <IfAccumulatedFileSize exceeds=\"${info_sys_accumulated_file_size}GB\"/>\n"
+ " </IfAny>\n"
+ " </Delete>\n"
+ " </DefaultRolloverStrategy>\n"
+ " </RollingFile>\n"
@ -75,7 +77,9 @@ public class Log4jConfig extends XmlConfiguration {
+ " <DefaultRolloverStrategy max=\"${sys_roll_num}\" fileIndex=\"max\">\n"
+ " <Delete basePath=\"${sys_log_dir}/\" maxDepth=\"1\">\n"
+ " <IfFileName glob=\"fe.warn.log.*\" />\n"
+ " <IfLastModified age=\"${sys_log_delete_age}\" />\n"
+ " <IfAny>\n"
+ " <IfAccumulatedFileSize exceeds=\"${warn_sys_accumulated_file_size}GB\"/>\n"
+ " </IfAny>\n"
+ " </Delete>\n"
+ " </DefaultRolloverStrategy>\n"
+ " </RollingFile>\n"
@ -90,7 +94,9 @@ public class Log4jConfig extends XmlConfiguration {
+ " <DefaultRolloverStrategy max=\"${audit_roll_num}\" fileIndex=\"max\">\n"
+ " <Delete basePath=\"${audit_log_dir}/\" maxDepth=\"1\">\n"
+ " <IfFileName glob=\"fe.audit.log.*\" />\n"
+ " <IfLastModified age=\"${audit_log_delete_age}\" />\n"
+ " <IfAny>\n"
+ " <IfAccumulatedFileSize exceeds=\"${audit_sys_accumulated_file_size}GB\"/>\n"
+ " </IfAny>\n"
+ " </Delete>\n"
+ " </DefaultRolloverStrategy>\n"
+ " </RollingFile>\n"
@ -218,6 +224,11 @@ public class Log4jConfig extends XmlConfiguration {
properties.put("audit_roll_maxsize", auditRollMaxSize);
properties.put("audit_roll_num", auditRollNum);
properties.put("audit_log_delete_age", auditDeleteAge);
properties.put("info_sys_accumulated_file_size", String.valueOf(Config.info_sys_accumulated_file_size));
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");
properties.put("audit_file_postfix", compressAuditLog ? ".gz" : "");