title: Rolling policy in logback is don't like what I want
body: <p>I have a problem when using <strong>logback</strong> to write log file daily (when a new day has been started,  <strong>logback</strong> compress the file to zip file).</p>
  
  <p>When I set the time is end of day, and run <strong>logback</strong>, it still run normally.
  But when the day has been <strong>changed</strong>, and <strong>logback</strong> was <strong>running</strong>...the old day log file still exist, and the zip file of old date and the new date log file have been created.</p>
  
  <p>I want when the new day come, the old log file compress to zip file and new day log file is created.</p>
  
  <p>Show me your ideas, please!
  thanks for your help.</p>
  
  <p>Here is my logback.xml config file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;appender name="RollByTimeComp"
      class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
          &lt;fileNamePattern&gt;c:/day-%d{yyyyMMdd}.log.zip
          &lt;/fileNamePattern&gt;
      &lt;/rollingPolicy&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5p] %m \(%F:%L\) %C:%M\(\)%n
          &lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  </code></pre>