0

I was facing an issue where logback was creating tmp files in the logs directory and in order to resolve the issue, I followed the instructions provided in the solution Spring Boot logback.xml creating .tmp Files and deleted the 'file' tag. But now when I deploy the new image of application on a kubernetes cluster, the application starts successfully but new log file is not generated and application logs are lost. If application is restarted or deployed freshly, then log file gets generated successfully.

<appender name="APPLOG"
        class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${LOG_FILE_LOCATION}/logsDirectory/Application.log</file>
        <rollingPolicy
            class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${LOG_FILE_BASE_PATH}/logs/TestApp.%d{yyyy-MM-dd}.%i.log.zip
            </fileNamePattern>
            <triggeringPolicy
            class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
                <!-- Size of single log file -->
                <maxFileSize>5MB</maxFileSize>
            </triggeringPolicy>
        </rollingPolicy>
        <encoder
            class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%d{yyyy-MM-dd HH:mm:ss:SSS} [%X{X-B3-TraceId:-}] %msg%n
            </pattern>
        </encoder>
</appender>
Shalabh
  • 1
  • 2

0 Answers0