<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NiFi logs not rolling over on Windows in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/360993#M238484</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/102452"&gt;@edaley&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a couple instances runnning on Windows and all of them rotates uses the TimeBasedRollingPolicy with the following configuration&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;appender name="APP_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&amp;gt;
        &amp;lt;!-- file&amp;gt;${org.apache.nifi.bootstrap.config.log.dir}/nifi-app.log&amp;lt;/file --&amp;gt;
        &amp;lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&amp;gt;
            &amp;lt;fileNamePattern&amp;gt;${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d.log.zip&amp;lt;/fileNamePattern&amp;gt;
            &amp;lt;maxHistory&amp;gt;30&amp;lt;/maxHistory&amp;gt;
        &amp;lt;/rollingPolicy&amp;gt;
        &amp;lt;immediateFlush&amp;gt;true&amp;lt;/immediateFlush&amp;gt;
        &amp;lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&amp;gt;
            &amp;lt;pattern&amp;gt;%date %level [%thread] %logger{40} %msg%n&amp;lt;/pattern&amp;gt;
        &amp;lt;/encoder&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;This configuration works over the nifi-app.log file and move it into a new file nifi-app_date.log.zip at midnight.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2023 02:10:38 GMT</pubDate>
    <dc:creator>templarian</dc:creator>
    <dc:date>2023-01-11T02:10:38Z</dc:date>
    <item>
      <title>NiFi logs not rolling over on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/359674#M238163</link>
      <description>&lt;P&gt;I manage NiFi installations for various clients within our company. On any servers or client systems running a Windows-based operating system, and on any version of NiFi I currently maintain (1.11.4, 1.16.3, 1.19.1), NiFi does not roll over logs using the default logback.xml.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;appender name="APP_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&amp;gt;
        &amp;lt;file&amp;gt;${org.apache.nifi.bootstrap.config.log.dir}/nifi-app.log&amp;lt;/file&amp;gt;
        &amp;lt;rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"&amp;gt;
            &amp;lt;!--
              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'.
            --&amp;gt;
            &amp;lt;fileNamePattern&amp;gt;${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log&amp;lt;/fileNamePattern&amp;gt;
            &amp;lt;maxFileSize&amp;gt;100MB&amp;lt;/maxFileSize&amp;gt;
            &amp;lt;!-- keep 30 log files worth of history --&amp;gt;
            &amp;lt;maxHistory&amp;gt;30&amp;lt;/maxHistory&amp;gt;
        &amp;lt;/rollingPolicy&amp;gt;
        &amp;lt;immediateFlush&amp;gt;true&amp;lt;/immediateFlush&amp;gt;
        &amp;lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&amp;gt;
            &amp;lt;pattern&amp;gt;%date %level [%thread] %logger{40} %msg%n&amp;lt;/pattern&amp;gt;
        &amp;lt;/encoder&amp;gt;
    &amp;lt;/appender&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works as expected on Linux-based operating systems, where the log is rolled over after an hour or when it exceeds the max file size.&lt;/P&gt;&lt;P&gt;On Windows systems, the only file that is created is nifi-app.log. It is never rolled over and keeps growing in size infinitely. This leads to performance issues and requires manual intervention and interrupting uptime once in a while, as we otherwise risk running out of disk space sooner or later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this topic: &lt;A href="https://community.cloudera.com/t5/Support-Questions/Nifi-1-2-0-on-Windows-2012-Server-is-not-rolling-over-its/td-p/224826" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/Support-Questions/Nifi-1-2-0-on-Windows-2012-Server-is-not-rolling-over-its/td-p/224826&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, the solution provided within disables creation of e.g. nifi-app.log (without any date/time suffixes). This file being created and rolled over is a requirement by some of my clients as they have data flows that depend on it already running in place. The expectation is that NiFi works the same across Linux and Windows installations, so adapting these data flows is not an option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to have log rollover work on Windows the way it does on Linux by default? Ideally, nifi-app.log exists and is written to by default, and after a period of time or if the log grows bigger than a defined file size, its contents are rolled over.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 05:04:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/359674#M238163</guid>
      <dc:creator>edaley</dc:creator>
      <dc:date>2022-12-16T05:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi logs not rolling over on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/360992#M238483</link>
      <description>&lt;P&gt;Any update on this? I can't imagine that this is the expected and accepted default behavior. There surely has to be a solution for something as fundamental as this.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 00:42:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/360992#M238483</guid>
      <dc:creator>edaley</dc:creator>
      <dc:date>2023-01-11T00:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi logs not rolling over on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/360993#M238484</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/102452"&gt;@edaley&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a couple instances runnning on Windows and all of them rotates uses the TimeBasedRollingPolicy with the following configuration&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;appender name="APP_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&amp;gt;
        &amp;lt;!-- file&amp;gt;${org.apache.nifi.bootstrap.config.log.dir}/nifi-app.log&amp;lt;/file --&amp;gt;
        &amp;lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&amp;gt;
            &amp;lt;fileNamePattern&amp;gt;${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d.log.zip&amp;lt;/fileNamePattern&amp;gt;
            &amp;lt;maxHistory&amp;gt;30&amp;lt;/maxHistory&amp;gt;
        &amp;lt;/rollingPolicy&amp;gt;
        &amp;lt;immediateFlush&amp;gt;true&amp;lt;/immediateFlush&amp;gt;
        &amp;lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&amp;gt;
            &amp;lt;pattern&amp;gt;%date %level [%thread] %logger{40} %msg%n&amp;lt;/pattern&amp;gt;
        &amp;lt;/encoder&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;This configuration works over the nifi-app.log file and move it into a new file nifi-app_date.log.zip at midnight.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 02:10:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/360993#M238484</guid>
      <dc:creator>templarian</dc:creator>
      <dc:date>2023-01-11T02:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi logs not rolling over on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/361084#M238504</link>
      <description>&lt;P&gt;Thank you very much for the response and suggestion. I tried to implement this in our test environment, which resulted in a nifi-app_2023-01-11.log file being created, but nifi-app.log is never created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried changing the timestamp format of fileNamePattern to %d{yyyy-MM-dd_HH_mm} to trigger rollovers every minute. Again, log files including the timestamps are created, but nifi-app.log is not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried uncommenting the &amp;lt;file&amp;gt; line. Now, nifi-app.log is created, but rollover is no longer working - nifi-app.log is the only file that is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It feels like I can either get nifi-app.log or rollover working at any one time, but never both at the same time. Any way to get both working at the same time?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 22:49:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/361084#M238504</guid>
      <dc:creator>edaley</dc:creator>
      <dc:date>2023-01-11T22:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi logs not rolling over on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/412614#M253569</link>
      <description>&lt;P&gt;Wanted to reply because I was also having this issue on Windows Server.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86328"&gt;@templarian&lt;/a&gt;&amp;nbsp;has the working solution.&lt;BR /&gt;Whenever you first start NiFi leave the logback configurations unchanged, however we set ours to debug to have more insight into the issue.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;configuration scan="true" scanPeriod="30 seconds" debug="true"&amp;gt;
...
&amp;lt;/configuration&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;NiFi's PID is blocking the file constantly, never releasing it, this causes the RollingFileAppender to never be able to change the filename:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;16:32:07,611 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - No removal attempts were made on account of totalSizeCap=3221225472
16:32:07,613 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - No removal attempts were made on account of totalSizeCap=3221225472
16:32:22,499 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [C:\nifi-2.5.0\logs\nifi-app.log] to [C:\nifi-2.5.0\logs\nifi-app_2025-10-07_16.0.log5423244956573500.tmp]
16:32:22,499 |-WARN in c.q.l.co.rolling.helper.RenameUtil - Failed to rename file [C:\nifi-2.5.0\logs\nifi-app.log] as [C:\nifi-2.5.0\logs\nifi-app_2025-10-07_16.0.log5423244956573500.tmp].
16:32:22,501 |-WARN in c.q.l.co.rolling.helper.RenameUtil - Please consider leaving the [file] option of RollingFileAppender empty.
16:32:22,502 |-WARN in c.q.l.co.rolling.helper.RenameUtil - See also https://logback.qos.ch/codes.html#renamingError&lt;/LI-CODE&gt;&lt;P&gt;Our workaround was to leave it unchanged on the first launch of NiFi and then remove all the &amp;lt;file/&amp;gt; properties for each appender once each file was initially created. Logback automatically applies these settings so there should be no disruption to NiFi.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The appender configuration is identical to&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/86328"&gt;@templarian&lt;/a&gt;'s suggestion. This got rotation and compression working for each of our appenders.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 17:11:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/412614#M253569</guid>
      <dc:creator>garb</dc:creator>
      <dc:date>2025-10-07T17:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi logs not rolling over on Windows</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/412623#M253574</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/133563"&gt;@garb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;There is an existing Apache NiFi jira reporting this issue here:&lt;BR /&gt;&lt;A href="https://issues.apache.org/jira/browse/NIFI-14729" target="_blank"&gt;https://issues.apache.org/jira/browse/NIFI-14729&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It aligns with your observations above.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 17:36:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-logs-not-rolling-over-on-Windows/m-p/412623#M253574</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2025-10-08T17:36:37Z</dc:date>
    </item>
  </channel>
</rss>

