Manish,

When you say everything is going into a single file, are you saying that
nifi-app.log, nifi-user.log, and nifi-bootstrap.log all never roll?

I just tested the nifi-app.log by running NiFi for over an hour and it
rolled exactly at 4pm and ended up with:

nifi-app.log
nifi-app_2016-10-04_15.0.log

The current hour will always be in nifi-app.log.

The boostrap and user logs are set to roll per day, so you would have edit
their fileNamePattern to include %d{yyyy-MM-dd_HH}  rather than just %d  if
you wanted them to roll per hour.

-Bryan


On Tue, Oct 4, 2016 at 10:12 AM, Manish Gupta 8 <[email protected]>
wrote:

> Hi Bryan,
>
>
>
> My app-log settings look as following, but the file is definitely not
> getting created every hour. Everything is going into a single file only.
> And, this is the default configuration.
>
> I am on 0.7.
>
>
>
>     <appender name="APP_FILE" class="ch.qos.logback.core.
> rolling.RollingFileAppender">
>
>         <file>${org.apache.nifi.bootstrap.config.log.dir}/
> 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>${org.apache.nifi.bootstrap.config.log.dir}
> /nifi-app_%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
>
>             <timeBasedFileNamingAndTriggeringPolicy
> class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
>
>                 <maxFileSize>100MB</maxFileSize>
>
>             </timeBasedFileNamingAndTriggeringPolicy>
>
>             <!-- keep 30 log files worth of history -->
>
>             <maxHistory>30</maxHistory>
>
>         </rollingPolicy>
>
>         <encoder class="ch.qos.logback.classic.
> encoder.PatternLayoutEncoder">
>
>             <pattern>%date %level [%thread] %logger{40} %msg%n</pattern>
>
>             <immediateFlush>true</immediateFlush>
>
>         </encoder>
>
>     </appender>
>
>
>
>
>
>
>
>
>
> Regards,
>
> Manish
>
>
>
> *From:* Bryan Bende [mailto:[email protected]]
> *Sent:* Tuesday, October 04, 2016 7:35 PM
> *To:* [email protected]
> *Subject:* Re: Configure Logging - Rolling
>
>
>
> Hello,
>
>
>
> I believe nifi-app.log is already doing hourly rollover with a max of
> 100mb per file.
>
>
>
> The logback.xml contains some comments that explain how to change it for
> different rollovers:
>
> https://github.com/apache/nifi/blob/master/nifi-nar-
> bundles/nifi-framework-bundle/nifi-framework/nifi-resources/
> src/main/resources/conf/logback.xml#L24-L30
>
>
>
> The nifi-bootstrap.log looks like it is set to daily because it only has
> %d
>
> https://github.com/apache/nifi/blob/master/nifi-nar-
> bundles/nifi-framework-bundle/nifi-framework/nifi-resources/
> src/main/resources/conf/logback.xml#L71
>
>
>
> Thanks,
>
>
>
> Bryan
>
>
>
>
>
> On Tue, Oct 4, 2016 at 9:57 AM, Manish Gupta 8 <[email protected]>
> wrote:
>
> Hi,
>
>
>
> Is there any documentation/example for setting rolling app and bootstrap
> log file. I want NiFi to create a new file every one hour. By default,
> everything goes into a single file.
>
> I couldn’t find much about logback.xml in admin/dev guide.
>
>
>
> Thanks,
>
> Manish
>
>
>
>
>

Reply via email to