<div dir="ltr">Hi,<br>I ran a profiler to analyze this issue. <br>Attaching the output
of the calling trace so somebody who is aware of the calling sequence in
depth can make out what is going wrong here.<br><br>Thanks!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 8, 2012 at 9:22 PM, 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">Forgot to mention, my logback.xml says:<br>file: <dir>/test.log <br>fileNamePattern: <dir>/test.%d{yyyy-MM-dd}.%d{HHmmssSSS,aux}.log<br>
<br>and rollover happened appropriately for the first time (so I have test.2012-11-08.202336641.log created) and the mentioned error keeps coming continuously thereafter attempting to rename test.log again to test.2012-11-08.202336641.log everytime. <br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 8, 2012 at 9:18 PM, 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>I am seeing the following error when rollover happens (this keeps coming continuously on stdout/err):<br>
<br><b>20:25:38,351 |-WARN in c.q.l.co.rolling.helper.RenameUtil - Failed to rename file [D:\test.log] to [D:\test.2012-11-08.202336641.log].<br>
...<br>20:25:38,351 |-WARN in ch.qos.logback.core.rolling.helper.SizeAndTimeBasedArchiveRemover@6d3374 - Unexpected periodsElapsed value 0<br></b><br><br>I am using RollingFileAppender with TimeBasedRollingPolicy and trigger is timeBasedFileNamingAndTriggeringPolicy with class="MyOwnSizeAndTimeBasedFNATP" defined as:<br>
<br>@NoAutoStart<br>public class MyOwnSizeAndTimeBasedFNATP<E> extends SizeAndTimeBasedFNATP<E><br>{<br> private final AtomicBoolean trigger = new AtomicBoolean();<br><br> @Override<br> public boolean isTriggeringEvent(final File activeFile, final E event) {<br>
if (trigger.compareAndSet(false, true) && activeFile.length() > 0) {<br> String maxFileSize = getMaxFileSize();<br> setMaxFileSize("1");<br> super.isTriggeringEvent(activeFile, event);<br>
setMaxFileSize(maxFileSize);<br> return true;<br> }<br><br> return super.isTriggeringEvent(activeFile, event);<br> }<br><br><br>Any suggestions on what could have gone wrong here? I tried to dig deeper into the logback code to identify the problem. I feel I am somehow entering RollingFileAppender's subAppend() multiple times or violating the synchronised behaviour as mentioned in the comment in the code.<br>
<br>Any pointers please?<br><br>Thanks!<br><br><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>