title: Spring Boot logback.xml creating .tmp Files
body: <p>I am trying to persist the logs of a Spring Boot Application, however, since the logs generated are large I am trying to use the logback.xml to roll the file greater than 350MB into a compressed file.</p>
  <p>I am able to roll a couple of MB's per day but midway the service starts writing to a temp file. I have tried both &quot;TimeBasedRollingPolicy&quot; and &quot;Size AndTimeBasedRollingPolicy&quot; with Triggering Policy of &quot;SizeAndTimeBasedFNATP&quot; but the results are unchanged. The .tmp files are generated every time.</p>
  <p>My Logback.xml looks like this:</p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;configuration&gt;
  
      &lt;appender name=&quot;FILE&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;
          &lt;file&gt;/home/xyz/logs/ProdLog.log&lt;/file&gt;
          &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;
              &lt;fileNamePattern&gt;/home/xyz/logs/log_%d{yyyy-MM-dd}_%i.log.zip&lt;/fileNamePattern&gt;
              &lt;timeBasedFileNamingAndTriggeringPolicy class=&quot;ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP&quot;&gt;
                  &lt;!-- or whenever the file size reaches 350MB --&gt;
                  &lt;maxFileSize&gt;350MB&lt;/maxFileSize&gt;
              &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
              &lt;maxHistory&gt;5&lt;/maxHistory&gt;
              &lt;!--&lt;maxFileSize&gt;350MB&lt;/maxFileSize&gt;--&gt;
          &lt;/rollingPolicy&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%date [%thread] %-5level %logger{35} - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
          &lt;layout class=&quot;ch.qos.logback.classic.PatternLayout&quot;&gt;
          &lt;Pattern&gt;
          %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
          &lt;/Pattern&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root level=&quot;INFO&quot;&gt;
          &lt;appender-ref ref=&quot;FILE&quot;/&gt;
          &lt;appender-ref ref=&quot;STDOUT&quot;/&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/zW0xT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zW0xT.png" alt="enter image description here" /></a></p>
  <p>I see that the ticket for logback .tmp file issue is marked closed on Jira. Could someone help with what needs to be modified here to avoid generating the temp files?</p>