my system support group needs one simple log file with maximum size 10 MB Old log lines can be deleted when the file reaches 10 MB. So expand the oldest lines.
What good is this? I have one appender , but this one still created a second file , and then it starts up again with an empty new file . This is not what my support team wants.
Help is appreciated.
<configuration> <appender name="TEST" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOG_HOME}/test.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <fileNamePattern>${LOG_HOME}/test.%i.log</fileNamePattern> <minIndex>1</minIndex> <maxIndex>1</maxIndex> </rollingPolicy> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <maxFileSize>10MB</maxFileSize> </triggeringPolicy> <encoder> <pattern>%date %-5level [%thread] - %mdc{loginName} - [%logger]- %msg%n</pattern> </encoder> </appender> <root level="DEBUG"> <appender-ref ref="FILE" /> </root> </configuration>
source share