<div dir="ltr">Hello<div> Thanks for the answer. I am still a bit confused.</div><div>If the logback FileNamePattern is "<span style="color:rgb(80,0,80)">app.log.%d{yyyyMMd</span><span style="color:rgb(80,0,80)">d_HHmmss}Z.log", would this by default mean its going to rollover every second? In other words , does the fileNamePattern define the rollover schedule?</span></div><div><span style="color:rgb(80,0,80)"><br>You mention using "yyyy-ww" to trigger a weekly Rollover, would this mean the fileName pattern should be made</span></div><div><span style="color:rgb(80,0,80)">"app.log%d{yyyy-ww}Z.log" ? <br><br>Is it possible to decouple the Name of the Rolled over log file and the tiriggering of RollOver ? What if Iwant a rollover every week , but the name of the Rolled Over file to have hhmmss as part of it? I Sorry if I have caused confusion here<br><br>Best Regards</span></div><div><span style="color:rgb(80,0,80)">Ani</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 12, 2024 at 12:36 PM Ceki Gulcu via logback-user <<a href="mailto:logback-user@qos.ch">logback-user@qos.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ani,<br>
<br>
Logback does not support cron-like triggering. However, it supports<br>
triggering based on a date pattern, e.g "yyyy-MM-dd"<br>
<br>
The schedule "0 0 * * 1 ?" corresponds to first day of the week at<br>
midnight. The pattern "yyyy-ww" corresponds to the same triggering<br>
schedule.<br>
<br>
The link below provides more details:<br>
<br>
<a href="https://logback.qos.ch/manual/appenders.html#tbrpFileNamePattern" rel="noreferrer" target="_blank">https://logback.qos.ch/manual/appenders.html#tbrpFileNamePattern</a><br>
<br>
I hope this helps,<br>
<br>
-- <br>
Ceki Gülcü<br>
<br>
Sponsoring SLF4J/logback/reload4j at <a href="https://github.com/sponsors/qos-ch" rel="noreferrer" target="_blank">https://github.com/sponsors/qos-ch</a><br>
<br>
On 2/12/2024 8:44 PM, Aniruddha Shevade via logback-user wrote:<br>
> Hello<br>
> I am trying to migrate a application form log4j to logback. I do have<br>
> the following property defined in the existing log4j2.xml file, I do not<br>
> see any such equivalent in the logback.xml.<br>
> *How do I specify something like a CronTriggerPolicy as shown below?*<br>
> Any help would be appreciated.<br>
> <br>
> log4j2.xml<br>
> <br>
> <RollingFile name="myLog" fileName="app.log" <br>
> filePattern"app.log.%d{yyyyMMdd_HHmmzz}Z.log><br>
> <Policies><br>
> * <CronTiggerPolicy schedule="0 0 * * 1 ?" evaluateOnStartup="true">*<br>
> <SizeBasedTriggerPolicy size="10MB"/><br>
> </Policies><br>
> </RollingFile><br>
> <br>
> <br>
> Best regards<br>
> Ani<br>
> <br>
_______________________________________________<br>
logback-user mailing list<br>
<a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>
<a href="https://mailman.qos.ch/cgi-bin/mailman/listinfo/logback-user" rel="noreferrer" target="_blank">https://mailman.qos.ch/cgi-bin/mailman/listinfo/logback-user</a></blockquote></div>