For our log /opt/apigee/var/log/edge-message-processor/edge-message-processor.log we are trying to implement log rotation as follows in /opt/apigee/edge-message-processor/source/conf/logback.xml
<appender name="EDGE_MESSAGEPROCESSOR_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${data.dir:-..}/edge-message-processor.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${data.dir:-..}/edge-message-processor-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- keep max of 10 days -->
<maxHistory>10</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 50MB -->
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="com.apigee.logging.MaskPatternLayout">
<patternsProperty>${sensitiveDataPattern}</patternsProperty>
<pattern>${defaultPattern}</pattern>
</layout>
</encoder>
</appender>
<logger name="EDGE_MESSAGEPROCESSOR_LOG" level="INFO" additivity="false">
<appender-ref ref="EDGE_MESSAGEPROCESSOR_LOG"/>
</logger>
We restarted MP, but its not working. Log file is now 100MB and also we waited for 2 days. We can see other files like “TRANSACTION_LOGS” are working fine. Issue is with this file only.