[logback-user] SizeAndTimeBasedArchiveRemover: Unexpected periodsElapsed value 0

Gaurav Kumar gaurav419 at gmail.com
Thu Nov 8 16:48:03 CET 2012


Hi,
I am seeing the following error when rollover happens (this keeps coming
continuously on stdout/err):

*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].
...
20:25:38,351 |-WARN in
ch.qos.logback.core.rolling.helper.SizeAndTimeBasedArchiveRemover at 6d3374 -
Unexpected periodsElapsed value 0
*

I am using RollingFileAppender with TimeBasedRollingPolicy and trigger is
timeBasedFileNamingAndTriggeringPolicy with
class="MyOwnSizeAndTimeBasedFNATP" defined as:

@NoAutoStart
public class MyOwnSizeAndTimeBasedFNATP<E> extends SizeAndTimeBasedFNATP<E>
{
    private final AtomicBoolean trigger = new AtomicBoolean();

    @Override
    public boolean isTriggeringEvent(final File activeFile, final E event) {
        if (trigger.compareAndSet(false, true) && activeFile.length() > 0) {
            String maxFileSize = getMaxFileSize();
            setMaxFileSize("1");
            super.isTriggeringEvent(activeFile, event);
            setMaxFileSize(maxFileSize);
            return true;
        }

        return super.isTriggeringEvent(activeFile, event);
    }


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.

Any pointers please?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20121108/2e8110cc/attachment.html>


More information about the Logback-user mailing list