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]<mailto:[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