MaxFileSize in timeBasedFileNamingAndTriggeringPolicy not working?

In NiFi-0.6.1 I am trying to reduce the size of the nifi-app.log to be saved in a local directory.

In this conf \ logback.xml I have configured "MaxFileSize" to be 1 MB. I think the only storage for nifi-app.log should only be 1MB in size. But he doesn't. He always keeps every log.

<appender name="APP_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logs/nifi-app.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!--
              For daily rollover, use 'app_%d.log'.
              For hourly rollover, use 'app_%d{yyyy-MM-dd_HH}.log'.
              To GZIP rolled files, replace '.log' with '.log.gz'.
              To ZIP rolled files, replace '.log' with '.log.zip'.
            -->
            <fileNamePattern>./logs/nifi-app_%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>1MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
            <!-- keep 30 log files worth of history -->
            <maxHistory>1</maxHistory>
        </rollingPolicy>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>
            <immediateFlush>true</immediateFlush>
        </encoder>
    </appender>

      

Now I need to install 1MB for nifi-app.log.

How do I set the size for nifi-app.log?

+3


source to share


1 answer


It looks like it was a bug in the 0.X version of Nifi, as discussed here .



This was fixed in later versions of Nifi, so using them is probably the most desirable way to solve the problem.

0


source







All Articles