I got stuck at a point where I was configuring my logback-spring.xml file. The problem is that my old archived files are not deleted, but Spring boot recognizes the xml file. I can see the changes when I change the e.g. maxFileSize parameter. Only maxHistory does not react properly: when I set it to 90 days, it deletes 3-4 files randomly. I have around 200 archived files(overall from 2018 and 2019 year). Thanks in advance.
I renamed file name from logback.xml to logback-spring.xml, but no changes.
--- logback-spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOG_PATH" value="log/" />
<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{dd.MM.yyyy HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}spring-boot.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>
%d{dd.MM.yyyy HH:mm:ss} [%thread] %-5level %logger{36} -
%msg%n
</Pattern>
</encoder>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${LOG_PATH}spring-boot.log.%d{yyyy-MM-
dd}.%i.gz</fileNamePattern>
<maxHistory>90</maxHistory>
<maxFileSize>100KB</maxFileSize>
</rollingPolicy>
</appender>
<logger name="org.springframework.web" level="info" additivity="false">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</logger>
<logger name="de.jarvia.baumangel" level="debug" additivity="false">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.hibernate.SQL" level="error" additivity="false">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</logger>
<root level="info">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
--- in application.properties
#### Logging files
logging.level.org.springframework.web=INFO
logging.file=log/spring-boot.log
logging.level.org.hibernate.SQL=ERROR
logging.level.de.jarvia.baumangel=DEBUG
#### Logging pattern for the console
logging.pattern.console=%d{dd.MM.yyyy HH:mm:ss} [%thread] %-5level
%logger{36} - %msg%n
#### Logging pattern for file
logging.pattern.file=%d{dd.MM.yyyy HH:mm:ss} [%thread] %-5level
%logger{36} -
%msg%n
--- in pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath></relativePath>
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>