[logback-dev] having trouble with logs and rolling over

Ceki Gülcü ceki at qos.ch
Thu Apr 8 23:00:33 CEST 2010


Hello Jason,

Time *and* size based rolling was introduced in version 0.9.17. By the way, 
logback should be complaining about not being able to handle 
'timeBasedFileNamingAndTriggeringPolicy' as well as other elements.

BTW, this is the developer's list. Your message is better suited for the user's 
list.

HTH,

On 08/04/2010 6:29 PM, Jason Roscoe wrote:
> I have the below configuration where I want to have a log file roll over
> either at midnight or when the log gets to 100MB. We are using logback
> version 0.9.15 at the moment. Using the below, I'm actually not getting
> any logging. Could someone help me with this?
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <configuration>
>
> <appender class="ch.qos.logback.core.rolling.RollingFileAppender"
> name="RootFileAppender">
>
> <file>/apps/projects/liferay/logs/my-subscriptions.log</file>
>
> <append>true</append>
>
> <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
>
> <level>debug</level>
>
> </filter>
>
> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>
> <!-- rollover daily -->
>
> <fileNamePattern>/apps/projects/liferay/logs/my-subscriptions.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
>
>
> <timeBasedFileNamingAndTriggeringPolicy
> class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
>
> <!-- or whenever the file size reaches 100MB -->
>
> <maxFileSize>100MB</maxFileSize>
>
> </timeBasedFileNamingAndTriggeringPolicy>
>
> <maxHistory>30</maxHistory>
>
> </rollingPolicy>
>
> <layout class="ch.qos.logback.classic.PatternLayout">
>
> <Pattern>%date %p [%c{0}] - %message%n</Pattern>
>
> </layout>
>
> </appender>
>
> <appender class="ch.qos.logback.core.ConsoleAppender"
> name="RootConsoleAppender">
>
> <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
>
> <level>info</level>
>
> </filter>
>
> <layout class="ch.qos.logback.classic.PatternLayout">
>
> <Pattern>%-4r [%t] %-5p %c %x - %m%n</Pattern>
>
> </layout>
>
> </appender>
>
> <root>
>
> <level value="debug"/>
>
> <appender-ref ref="RootFileAppender"/>
>
> <appender-ref ref="RootConsoleAppender"/>
>
> </root>
>
> </configuration>
>
> Thanks
>




More information about the logback-dev mailing list