title: How to keep rolling log file as per file size?
body: <p>I am working on a project in which I am logging bunch of stuff in a file and I want to make sure my log file is getting rolled as soon as a fixed limit for file is reached. I have a below <code>logback.xml</code> file but it looks like file size is not working. I see my file size as 793M but limit I have is 100M</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;appender name="FILE" class="ch.qos.logback.core.FileAppender"&gt;
          &lt;file&gt;process.log&lt;/file&gt;
          &lt;triggeringPolicy
              class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"&gt;
              &lt;maxFileSize&gt;100MB&lt;/maxFileSize&gt;
          &lt;/triggeringPolicy&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
              &lt;fileNamePattern&gt;process%i.log&lt;/fileNamePattern&gt;
              &lt;minIndex&gt;1&lt;/minIndex&gt;
              &lt;maxIndex&gt;9&lt;/maxIndex&gt;
          &lt;/rollingPolicy&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%date %level [%thread] %msg%n&lt;/pattern&gt;
              &lt;!-- this improves logging throughput --&gt;
              &lt;immediateFlush&gt;true&lt;/immediateFlush&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder 
              by default --&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
              &lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;root level="INFO"&gt;
          &lt;appender-ref ref="FILE" /&gt;
          &lt;appender-ref ref="STDOUT" /&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>What wrong I am doing here? And also what is the best policy we should follow in production in terms of logging? We are logging bunch of stuff in a file and we don't want to fill up the disk with this log file.</p>