[logback-user] urgent explination issue

Ayman Hammoudeh Ayman.Hammoudeh at Progressoft.com
Thu Oct 1 15:31:06 CEST 2009


This is the way I'am doing it but  its not working .

Here is my xml configuration :

<configuration>
  <appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
   <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
   <FileNamePattern>mylog-%d.%i.log</FileNamePattern>
   <TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
   <MaxFileSize>5MB</MaxFileSize>
   </TimeBasedFileNamingAndTriggeringPolicy>
<MaxHistory>1</MaxHistory>
   </rollingPolicy>
   <layout>
   <Pattern>%msg%n</Pattern>
    </layout>
   </appender>
   <root level="debug">
   <appender-ref ref="ROLLING" />
   </root>
   </configuration>


Has any one tried it and worked!!?

From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Johan Bos
Sent: Thursday, October 01, 2009 2:28 PM
To: 'logback users list'
Subject: Re: [logback-user] urgent explination issue

You probably meant : <rollingPolicy> instead of <rollingPolisy>

<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <MaxHistory>5</MaxHistory>
 </rollingPolicy>

Or if desired max history only for the archive configuration:

<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<MaxFileSize>${sizeThreshold}</MaxFileSize>
<MaxHistory>5</MaxHistory>
</TimeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>

That the way I understood the documentation
________________________________
De : logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] De la part de Ayman Hammoudeh
Envoyé : jeudi 1 octobre 2009 15:12
À : logback-user at qos.ch
Objet : [logback-user] urgent explination issue

Hello,

I want to know how can I use max history  in Size and time based archiving<http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedFNATP>  and where exactly to put the<MaxHistory> tag in the xml , I have tried to put it in the <RollingPolisy> tag but its not working.

Any help would be appreciated.



Best Regards,
Ayman Hammoudeh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20091001/779eb3f8/attachment.htm>


More information about the Logback-user mailing list