<div dir="ltr">any suggestions?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 7, 2012 at 2:50 AM, Gaurav Kumar <span dir="ltr"><<a href="mailto:gaurav419@gmail.com" target="_blank">gaurav419@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><br>With logback, is there a way to do daily Rollover AND also rollover on every server restart? <br>

I also wanted rollover based on Size, but I have seen an issue already reported about this being a bug. If not, what is the best way to do this?<br>
<br><br>My setup:<br>For daily rollover I am using the following pattern: <br><i> ....<br><file>${jetty.home}/logs/testapp.${dateStr}.log</file><br>....<br></i><i><fileNamePattern>${jetty.home}/logs/testapp.%d{yyyy-MM-dd}.log.${timeStr}</fileNamePattern><br>


<br>where dateStr and timeStr are defined as:<br></i><br><br><i><i><timestamp key="dateStr" datePattern="yyyy-MM-dd" timeReference="contextBirth"/><br></i><timestamp key="timeStr" datePattern="HHmmssSSS" timeReference="contextBirth"/><br>


<br><br>Also, I have the following triggering policy:</i><br><i><i><timeBasedFileNamingAndTriggeringPolicy class="utils.<b>LogbackLogTriggeringPolicy</b>"/></i><br><br></i><p><b>LogbackLogTriggeringPolicy.java is:</b></p>




<div><i>@NoAutoStart<br>public class LogbackLogTriggeringPolicy<E> extends DefaultTimeBasedFileNamingAndTriggeringPolicy<E> {<br>  @Override<br>      public void start() {<br>          super.start();<br>
          nextCheck = 0L;<br></i></div><i>

          isTriggeringEvent(null, null);<br>          try {<br>              tbrp.rollover();<br>          } catch (RolloverFailure e) {<br>              //Do nothing<br>          }<br>
      }<br>}<br><br><br>With the above </i>LogbackLogTriggeringPolicy I am able to achieve rollover on server startup but daily rollover is not working. Any suggestions?<br><br>Thanks!<br></div>
</blockquote></div><br></div>