title: Logback daily rolling incorrect
body: <p>We are using quite a basic daily rolling configuration with logback, and it seems not to function properly. Application creates rolled (previous day) file usually in first minute after midnight. The yyyyMMdd fraction of file name contans previous day, that's correct. But messages in log are not from previous but from new day, only that 30-40 seconds ! 
  For example, <strong>bim.2013-08-21.log</strong> file contains records with timestamps from <strong>2013.08.22 00:00:00</strong> to <strong>2013.08.22 00:00:42</strong>. And all messages from previous day gets lost.
  Also, there was some "lucky" exceptions when rolling started in the mid of the day , e.g. 16:00 , so we got more records rolled - from current day. </p>
  
  <p>Logback version is 1.0.13
  logback-test.xml :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configuration scan="true" scanPeriod="10 minutes"&gt;
  &lt;contextName&gt;bim&lt;/contextName&gt;
  
  &lt;property name="LOG_DIR" value="/usr/share/apache-tomcat-7.0.41/logs" /&gt;
  
  &lt;appender name="console" class="ch.qos.logback.core.ConsoleAppender"&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%d{HH:mm:ss.SSS} %-5level %m \(%logger{36}:%L\)%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  
  &lt;appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;file&gt;${LOG_DIR}/bim.log&lt;/file&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
          &lt;!-- daily rollover --&gt;
          &lt;fileNamePattern&gt;${LOG_DIR}/bim.%d{yyyy-MM-dd}.log&lt;/fileNamePattern&gt;
          &lt;maxHistory&gt;5&lt;/maxHistory&gt;
      &lt;cleanHistoryOnStart&gt;true&lt;/cleanHistoryOnStart&gt;
      &lt;/rollingPolicy&gt;
  
      &lt;encoder&gt;
          &lt;pattern&gt;%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %m \(%logger{36}:%L\)%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  
  &lt;logger name="com.bim" level="DEBUG" /&gt;
  &lt;logger name="org.springframework.web.servlet.mvc.support" level="WARN" /&gt;
  &lt;logger name="org.springframework.web.servlet.mvc.annotation" level="WARN" /&gt;
  
  &lt;root level="INFO"&gt;
      &lt;!--appender-ref ref="console" /--&gt;
      &lt;appender-ref ref="file" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have not found any traces of similar problems by search, so your help will be greatly appreciated.</p>