
Hi TJ, File name patterns with folder names depending on the date should work. Please try reproducing on a simple example (without SiftingAppender or CloseSTBFNATP). By the way, %d{HHmmss'/maxhist-key/key.'HHmmss} is quite a complex date pattern. I don't know if such date formats are supported by SimpleDateFormat. (They might be). -- Ceki http://twitter.com/#!/ceki On 11.11.2011 21:31, TJ Rothwell wrote:
Ceki,
I haven't tested against HEAD yet. But I was tweaking with <maxHistory>, and it doesn't appear to obey when the filename pattern changes on the folder. This might be an unsupported configuration, but thought it might work since I saw it as an example on the website. "/wombat/%d{yyyy/MM}/foo.txt" [1]
This is the config I'm testing with.
<appender name="FILE-${KEY}" class="ch.qos.logback.core.rolling.RollingFileAppender"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%d{HH:mm:ss.SSS zz} %-5level [%thread] %logger{35} [%-3X{KEY}] %msg%n</pattern> </encoder> <rollingPolicy class="com.touchnet.twp.contextconfig.lbclassic.CloseTBRP"> <fileNamePattern>${TEMP_FOLDER}/%d{HHmmss'/maxhist-key/key.'HHmmss}.${KEY}.%i.txt.zip</fileNamePattern> <maxHistory>1</maxHistory> <!-- date periods to keep in addition to current --> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.CloseSTBFNATP"> <maxFileSize>1</maxFileSize> <!-- testing if index values were counted in history --> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender>
[1] http://logback.qos.ch/manual/appenders.html
Thanks, -- TJ