Log file is not rolled over after reach the limit

386 Views Asked by At

I am trying to implement logback for my project. If the file size is more than 10 MB then the file should roll over with timestamp. My code is working fine in local. But after i deployed to wildfly server its not roll over even it reached MaxFileSize 10 MB. Logs are keep on appending in same log file. And i am using Spring boot 2.1.1 Release with logback.version 1.2.3. below is my config file for logback.

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <include resource="org/springframework/boot/logging/logback/default.xml"/>
    <include resource="org/springframework/boot/logging/logback/file-appender.xml" />
    <include resource="org/springframework/boot/logging/logback/console-appender.xml" />

        <appender name="ROLL" class="ch.qos.logback.core.rolling.RollingFileAppender">
            <file>Test1.log</file>
            <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
                <fileNamePattern>Test1.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
        <maxFileSize>10MB</maxFileSize>
                <maxHistory>7</maxHistory>
        <totalSizeCap>1GB</totalSizeCap>
            </rollingPolicy>
            <encoder>
                <pattern>${FILE_LOG_PATTERN}</pattern>
            </encoder>
        </appender>

        <root level="ERROR">
            <appender-ref ref="ROLL"/>
        </root>
    </configuration>

Please suggest me.

0

There are 0 best solutions below