0
我在logback.xml中使用了以下內容。這隻保留了21個文件並刪除了較舊的日誌文件。任何人都可以請建議如何停止文件刪除?Logback日誌文件輪換策略
<appender name="MY_UPDATES_APPENDER"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender -->
<File>logs/upilogs/upi-app.log
</File>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>logs/upilogs/my-app.%i.log
</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>50</maxIndex>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>200MB</maxFileSize>
</triggeringPolicy>
<encoder>
<Pattern>%d %X %-5level %logger{36} - %msg%n%ex</Pattern>
</encoder>
</appender>