[logback-user] Rolling files on Android

Tony Trinh tony19 at gmail.com
Sun Dec 7 00:29:23 CET 2014


To help troubleshoot rollover issues, you can enable logback debug
statements with:

           LoggerContext context = (LoggerContext)

        // Enable debugging to show rollover status

This will print any status messages when logback attempts to rollover the

See the working example that demonstrates the RollingFileAppender:


On Tue, Dec 2, 2014 at 5:48 PM, Chris Kelly <chris at thursby.com> wrote:

> I've gone through a bit of trial and error, and have not been able to get
> logs to roll over, no matter how aggressively I set up triggering and
> rolling policies.
> My intent is to have daily logs with a max size all configured in code,
> thus no assets/logback.xml.
> I've enabled debugging and the only status message is (which I would
> expect):
>         I/System.out﹕ 17:37:13,194 |-INFO in
> ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource
> [assets/logback.xml]
> In a nutshell I have the TimeBasedRollingPolicy set up to use a file as
> rollingPolicy.setFileNamePattern(ctx.getCacheDir().getAbsolutePath() +
> File.separator + "logs" + File.separator + name +".%d{yyyy-MM-dd_HH}.log");
> // exprimenting with hourly
> and the size based triggering at 25k like
>         sizeTriggerPolicy.setMaxFileSize("25KB");
> I then set these to the rollingFileAppender, set up a pattern encoder and
> add it, then start the appender.
> I can see the messages in my log file as expected, but it continues to
> grow well past the max size and past any time based trigger (even while log
> events continue).
> Any suggestions?
> Thanks,
> Chris
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20141206/8127c886/attachment.html>

More information about the Logback-user mailing list