[logback-user] Logback configuration

Neha Kothari neha.kothari at db.com
Mon Apr 25 16:52:13 CEST 2011


If I have a configuration file like the following:

<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>test.log</File>
        <encoder>
            <pattern>... </pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>test.%d{yyyy-MM}.%i.log</fileNamePattern>
            <maxHistory>2</maxHistory>
            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>10MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>

The max history parameter here , does it mean

test.2011-04.0.log
test.2011-04.1.log
And then renaming test.log.2011-04.1.log to test.2011-04.0.log. The new logs go to the file test.2011-04.1.log

Or does it mean

test.2011-04.0.log
test.2011-04.1.log
test.2011-04.2.log
test.2011-04.3.log
test.2011-04.4.log..... Having as many index as needed. But saving this files for 2 months. So that we have something like the following:


test.2011-04.0.log
test.2011-04.1.log
test.2011-04.2.log
test.2011-04.3.log.......
test.2011-05.0.log
test.2011-05.1.log......

Now when we have logs for 2011-06 delete the logs for 2011-04.

Which condition applies when you have maxHistory for a filename pattern like
'<fileNamePattern>test.%d{yyyy-MM}.%i.log</fileNamePattern>'

Thanks
Neha


---
This communication may contain confidential and/or privileged information. If you are not the intended recipient (or have received this communication in error) please notify the sender immediately and destroy this communication. Any unauthorized copying, disclosure or distribution of the material in this communication is strictly forbidden.
Deutsche Bank does not render legal or tax advice, and the information contained in this communication should not be regarded as such.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110425/38e575c3/attachment-0001.html>


More information about the Logback-user mailing list