Skip to content

Commit

Permalink
Better rolling policy. The old policy (FixedWindowRollingPolicy) wait…
Browse files Browse the repository at this point in the history
…ed 1 minute between checking file sizes, which during heavy logging could lead to much larger file sizes than anticipated,but the new one checks continuously.
  • Loading branch information
flexable777 committed Feb 28, 2025
1 parent a408d13 commit 068b26f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@

<appender name="secureJson" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/secure-logs/secure.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>/secure-logs/secure.log.%i</fileNamePattern>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>/secure-logs/secure.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxHistory>30</maxHistory>
<minIndex>1</minIndex>
<maxIndex>1</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxIndex>4</maxIndex>
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
<totalSizeCap>115MB</totalSizeCap>
</rollingPolicy>
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
</appender>

Expand Down

0 comments on commit 068b26f

Please sign in to comment.