title: Log4j 2 rollover not happening at expected time
body: <p>I am using log4j2 Rolling File appender for logging. The traffic for the logger is quite sparse. I want the logger to rollover the file at the appropriate time. How can i do that ?</p>
  
  <p>This is the output of ls -lrth command on the log files.</p>
  
  <hr>
  
  <pre><code>-rw-r--r-- 1 root root  136 Apr 27 15:51 logfile-04-20150427-07-00.log.gz
  -rw-r--r-- 1 root root  133 Apr 27 23:18 logfile-04-20150427-15-00.log.gz
  -rw-r--r-- 1 root root  151 Apr 28 04:40 logfile-04-20150427-23-00.log.gz
  -rw-r--r-- 1 root root  161 Apr 28 05:14 logfile-04-20150428-04-00.log.gz
  -rw-r--r-- 1 root root  134 Apr 28 06:45 logfile-04-20150428-05-00.log.gz
  -rw-r--r-- 1 root root  125 Apr 28 08:46 logfile-04-20150428-06-00.log.gz
  -rw-r--r-- 1 root root  191 Apr 28 09:27 logfile-04-20150428-08-00.log.gz
  -rw-r--r-- 1 root root  281 Apr 28 10:43 logfile-04-20150428-09-00.log.gz
  </code></pre>
  
  <p>Clearly the logger is not rotating the logfile at the apt time. (see the modification time of the file and the logfile timestamp).
  The following is my log4j2.xml configuration for the logger.</p>
  
  <pre><code>&lt;RollingFile name="userlogfileAppender"
               fileName="${sys:catalina.home}/webapps/miscLogs/uData/logfile/logfile.log"
               filePattern="${sys:catalina.home}/webapps/miscLogs/uData/logfile/logfile-${logfileId}-%d{yyyyMMdd-HH}-00.log.gz"
               immediateFlush="true"
               bufferedIO="false"&gt;
          &lt;PatternLayout&gt;
          &lt;/PatternLayout&gt;
          &lt;Policies&gt;
              &lt;TimeBasedTriggeringPolicy interval="1" modulate="true"/&gt;
          &lt;/Policies&gt;
      &lt;/RollingFile&gt;
  
      &lt;logger additivity="false" name="userlogfileLogger" level="debug"&gt;
          &lt;AppenderRef ref="userlogfileAppender"/&gt;
  </code></pre>