title: Log4j2 auto rollover scheduler
body: <p>How can I configure log4j2 for rollover every 30 seconds?</p>
  
  <p>For example, if today is 2019-01-09 09:45:00 and I write data into the log file by command </p>
  
  <pre><code>log.info("test")
  </code></pre>
  
  <p>no more data goes to log for the 10 minutes,
  but I need auto rollover log file after 30 seconds in 2019-01-09 09:45:30.</p>
  
  <p>If I configure log4j2 that's way:</p>
  
  <pre><code>&lt;RollingFile name="RollingFile"&gt;
    &lt;FileName&gt;C:/log/mylog.log&lt;/FileName&gt;
    &lt;FilePattern&gt;C:/log/time-based-logs/%d{yyyy-MM-dd-hh-mm}.log.zip&lt;/FilePattern&gt;
    &lt;PatternLayout&gt;
      &lt;Pattern&gt;%d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %msg%n&lt;/Pattern&gt;
    &lt;/PatternLayout&gt;
    &lt;Policies&gt;
      &lt;TimeBasedTriggeringPolicy interval="2" modulate="true" /&gt;
    &lt;/Policies&gt;
    &lt;DefaultRolloverStrategy max="5" /&gt;
  &lt;/RollingFile&gt;
  </code></pre>
  
  <p>I must write into log data by the command </p>
  
  <pre><code>log.info("test1")      // 2019-01-09 09:55:00
  </code></pre>
  
  <p>and then goes rollover file after 10 minutes, but I need every 30 seconds even no write data into log anymore.</p>
  
  <p>How can I do it?</p>
  
  <p>and I apologize for my bad English.</p>