From 9fed593ab7a76e66a1f6e3552f27ab70f2d7ff7e Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 08 十月 2024 09:51:38 +0800 Subject: [PATCH] 优化log4j2.yml日志配置文件中的日志文件大小及文件数量配置 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/resources/log4j2.yml | 35 ++++++++++++++++++----------------- 1 files changed, 18 insertions(+), 17 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/resources/log4j2.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/resources/log4j2.yml index 013e24d..534a212 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/resources/log4j2.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/resources/log4j2.yml @@ -39,23 +39,24 @@ pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n" # 杈撳嚭鍒版枃浠讹紝瓒呰繃10MB褰掓。 RollingFile: - - name: ROLLING_FILE - ignoreExceptions: false - fileName: ${log.path}/${project.name}.log - filePattern: "${log.path}/$${date:yyyy-MM}/${project.name}-%d{yyyy-MM-dd}-%i.log.gz" - ThresholdFilter: - level: error #杈撳嚭鏃ュ織绾у埆锛岃緭鍑烘棩蹇楁椂锛岄鍏堢敱Loggers.Root.level鎴朙oggers.Logger.level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢辨湰level鍒ゆ柇鏄惁杈撳嚭 - onMatch: ACCEPT #onMatch=ACCEPT 澶т簬绛変簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織杈撳嚭 - onMismatch: DENY #onMismatch=DENY 灏忎簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織涓嶈緭鍑� - #鏃ュ織鍐呭鏍峰紡 - PatternLayout: - pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n" - Policies: - SizeBasedTriggeringPolicy: - size: "10 MB" - DefaultRolloverStrategy: - max: 1000 - + - name: ROLLING_FILE + ignoreExceptions: false + fileName: ${log.path}/${project.name}.log + filePattern: "${log.path}/${project.name}-%d{yyyy-MM-dd}-%i.log.gz" + ThresholdFilter: + level: error #杈撳嚭鏃ュ織绾у埆锛岃緭鍑烘棩蹇楁椂锛岄鍏堢敱Loggers.Root.level鎴朙oggers.Logger.level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢辨湰level鍒ゆ柇鏄惁杈撳嚭 + onMatch: ACCEPT #onMatch=ACCEPT 澶т簬绛変簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織杈撳嚭 + onMismatch: DENY #onMismatch=DENY 灏忎簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織涓嶈緭鍑� + #鏃ュ織鍐呭鏍峰紡 + PatternLayout: + pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n" + Policies: + # 姣忓ぉ鏃ュ織鏂囦欢鎸夊ぇ灏忓垎瀛愭枃浠� + SizeBasedTriggeringPolicy: + size: "1 MB" + DefaultRolloverStrategy: + max: 10 #涓�澶╁唴鏃ュ織鏂囦欢鏈�澶т釜鏁� + totalSizeCap: "100 MB" #鎵�鏈夋棩蹇楁枃浠剁殑鎬诲ぇ灏忛檺鍒� Loggers: Root: level: info #鏃ュ織杈撳嚭绾у埆锛屽叡鏈�8涓骇鍒紝鎸夌収浠庝綆鍒伴珮涓猴細all < trace < debug < info < warn < error < fatal < off -- Gitblit v1.8.0