We have an issue with MiNiFi (minifi-0.1.0 Java).

It is not rotating its logs as per conf/logback.xml maxHistory value.

Over the time, it is filling the drive and leaving many log files on desk.

many "minifi-app.log15558502285619089.tmp" files are left on desk.
please advice.



Thanks

Sumanth Chinthagunta



logback.xml





<?xml version="1.0" encoding="UTF-8"?>

<!--

  Licensed to the Apache Software Foundation (ASF) under one or more

  contributor license agreements.  See the NOTICE file distributed with

  this work for additional information regarding copyright ownership.

  The ASF licenses this file to You under the Apache License, Version 2.0

  (the "License"); you may not use this file except in compliance with

  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software

  distributed under the License is distributed on an "AS IS" BASIS,

  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  See the License for the specific language governing permissions and

  limitations under the License.

-->



<configuration scan="true" scanPeriod="30 seconds">

    <contextListener class="ch.qos.logback.classic.
jul.LevelChangePropagator">

        <resetJUL>true</resetJUL>

    </contextListener>



    <appender name="APP_FILE" class="ch.qos.logback.core.
rolling.RollingFileAppender">

        <file>${org.apache.nifi.minifi.bootstrap.config.log.
dir}/minifi-app.log</file>

        <rollingPolicy class="ch.qos.logback.core.rolling.
SizeAndTimeBasedRollingPolicy">

            <!--

              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>${org.apache.nifi.minifi.bootstrap.config.
log.dir}/minifi-app_%d{yyyy-MM-dd_HH}.%i.log.gz</fileNamePattern>

            <!-- Keep 10 rolling periods worth of log files-->

            <maxHistory>10</maxHistory>

            <!-- Max size each log file will be-->

            <maxFileSize>1MB</maxFileSize>

            <!--

                Provide a cap of 10 MB across all archive files

                NOTE: Size constraints are not guaranteed due to a bug in
logback as per

                http://jira.qos.ch/browse/LOGBACK-1166

            -->

            <totalSizeCap>10MB</totalSizeCap>

        </rollingPolicy>

        <encoder class="ch.qos.logback.classic.
encoder.PatternLayoutEncoder">

            <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

            <immediateFlush>true</immediateFlush>

        </encoder>

    </appender>



    <appender name="BOOTSTRAP_FILE" class="ch.qos.logback.core.
rolling.RollingFileAppender">

        <file>${org.apache.nifi.minifi.bootstrap.config.log.
dir}/minifi-bootstrap.log</file>

        <rollingPolicy class="ch.qos.logback.core.rolling.
TimeBasedRollingPolicy">

            <!--

              For daily rollover, use 'user_%d.log'.

              For hourly rollover, use 'user_%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>${org.apache.nifi.minifi.bootstrap.config.
log.dir}/minifi-bootstrap_%d.log.gz</fileNamePattern>

            <!-- Keep 5 rolling periods worth of logs-->

            <maxHistory>5</maxHistory>

        </rollingPolicy>

        <encoder class="ch.qos.logback.classic.
encoder.PatternLayoutEncoder">

            <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

        </encoder>

    </appender>



                <appender name="CONSOLE" class="ch.qos.logback.core.
ConsoleAppender">

                                <encoder class="ch.qos.logback.classic.
encoder.PatternLayoutEncoder">

            <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

        </encoder>

                </appender>



    <!-- valid logging levels: TRACE, DEBUG, INFO, WARN, ERROR -->



    <logger name="org.apache.nifi" level="INFO"/>

    <logger name="org.apache.nifi.processors" level="WARN"/>

    <logger name="org.apache.nifi.processors.standard.LogAttribute"
level="INFO"/>

    <logger name="org.apache.nifi.controller.repository.StandardProcessSession"
level="WARN" />



    <!-- Logger for managing logging statements for jetty -->

    <logger name="org.eclipse.jetty" level="INFO"/>



    <!-- Suppress non-error messages due to excessive logging by class or
library -->

    <logger name="com.sun.jersey.spi.container.servlet.WebComponent"
level="ERROR"/>

    <logger name="com.sun.jersey.spi.spring" level="ERROR"/>

    <logger name="org.springframework" level="ERROR"/>



    <!-- Suppress non-error messages due to known warning about redundant
path annotation (NIFI-574) -->

    <logger name="com.sun.jersey.spi.inject.Errors" level="ERROR"/>



    <!--

        Logger for capturing Bootstrap logs and MiNiFi's standard error and
standard out.

    -->

    <logger name="org.apache.nifi.minifi.bootstrap" level="INFO"
additivity="false">

        <appender-ref ref="BOOTSTRAP_FILE" />

    </logger>

    <logger name="org.apache.nifi.minifi.bootstrap.Command" level="INFO"
additivity="false">

        <appender-ref ref="CONSOLE" />

        <appender-ref ref="BOOTSTRAP_FILE" />

    </logger>



    <!-- Everything written to MiNiFi's Standard Out will be logged with
the logger org.apache.nifi.minifi.StdOut at INFO level -->

    <logger name="org.apache.nifi.minifi.StdOut" level="INFO"
additivity="false">

        <appender-ref ref="BOOTSTRAP_FILE" />

    </logger>



    <!-- Everything written to MiNiFi's Standard Error will be logged with
the logger org.apache.nifi.minifi.StdErr at ERROR level -->

                <logger name="org.apache.nifi.minifi.StdErr" level="ERROR"
additivity="false">

                <appender-ref ref="BOOTSTRAP_FILE" />

    </logger>





    <root level="INFO">

        <appender-ref ref="APP_FILE"/>

    </root>



</configuration>


-- 
Thanks,
Sumanth

Reply via email to