
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

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@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:12 À : logback-user@qos.ch Objet : [logback-user] urgent explination issue Hello, I want to know how can I use max history in Size <http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedFNATP> and time based archiving 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

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@qos.ch [mailto:logback-user-bounces@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@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:12 À : logback-user@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

That is exactly my point: You set up the maxhistory for the current file It is what you intend or do you want that option only for the archives? If only for the archive, you should then relocate your option into the <TimeBasedFileNamingAndTriggeringPolicy> node. Same level as <MaxFileSize> node. Otherwise, if only for the current log file, see which version you have, I remember that a bug issue has been known on log file history not being deleted. _____ De : logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:31 À : logback users list Objet : Re: [logback-user] urgent explination issue This is the way Iam 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@qos.ch [mailto:logback-user-bounces@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@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:12 À : logback-user@qos.ch Objet : [logback-user] urgent explination issue Hello, I want to know how can I use max history in Size <http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedFNATP> and time based archiving 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

What I want to roll back filed based on time and to delete older files and there archives if they are older than 2 days for example,.and iam using the latest version which is 0.9.17!! Here is my xml configuration again :): <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> <MaxHistory>2</MaxHistory> </TimeBasedFileNamingAndTriggeringPolicy> <MaxHistory>2</MaxHistory> </rollingPolicy> <layout> <Pattern>%msg%n</Pattern> </layout> </appender> <root level="debug"> <appender-ref ref="ROLLING" /> </root> </configuration> From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Johan Bos Sent: Thursday, October 01, 2009 2:50 PM To: 'logback users list' Subject: Re: [logback-user] urgent explination issue That is exactly my point: You set up the maxhistory for the current file It is what you intend or do you want that option only for the archives? If only for the archive, you should then relocate your option into the <TimeBasedFileNamingAndTriggeringPolicy> node. Same level as <MaxFileSize> node. Otherwise, if only for the current log file, see which version you have, I remember that a bug issue has been known on log file history not being deleted. ________________________________ De : logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:31 À : logback users list Objet : Re: [logback-user] urgent explination issue 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@qos.ch [mailto:logback-user-bounces@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@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:12 À : logback-user@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

What I want to roll back filed based on time and to delete older files and there archives if they are older than 2 days for example,.and iam using the latest version which is 0.9.17!! Here is my xml configuration again :): <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> <MaxHistory>2</MaxHistory> </TimeBasedFileNamingAndTriggeringPolicy> <MaxHistory>2</MaxHistory> </rollingPolicy> <layout> <Pattern>%msg%n</Pattern> </layout> </appender> <root level="debug"> <appender-ref ref="ROLLING" /> </root> </configuration> From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Johan Bos Sent: Thursday, October 01, 2009 2:50 PM To: 'logback users list' Subject: Re: [logback-user] urgent explination issue That is exactly my point: You set up the maxhistory for the current file It is what you intend or do you want that option only for the archives? If only for the archive, you should then relocate your option into the <TimeBasedFileNamingAndTriggeringPolicy> node. Same level as <MaxFileSize> node. Otherwise, if only for the current log file, see which version you have, I remember that a bug issue has been known on log file history not being deleted. ________________________________ De : logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:31 À : logback users list Objet : Re: [logback-user] urgent explination issue 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@qos.ch [mailto:logback-user-bounces@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@qos.ch [mailto:logback-user-bounces@qos.ch] De la part de Ayman Hammoudeh Envoyé : jeudi 1 octobre 2009 15:12 À : logback-user@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

Hello, Any internal error messages should be available via the StatusMessager. Just add the following line to your config file: <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" /> Ayman Hammoudeh wrote:
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@qos.ch [mailto:logback-user-bounces@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@qos.ch [mailto:logback-user-bounces@qos.ch] *De la part de* Ayman Hammoudeh *Envoyé :* jeudi 1 octobre 2009 15:12 *À :* logback-user@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
------------------------------------------------------------------------
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch
participants (3)
-
Ayman Hammoudeh
-
Ceki Gulcu
-
Johan Bos