Configure RollingFileAppender to keep a back up of Fifty log files in Logback

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Configure RollingFileAppender to keep a back up of Fifty log files in Logback

Govardhana
Hi,

I have used RollingFileAppender in logback Configuration file.  My requirement is to keep 50 log files [ maxIndex ]as back up.

Please give me some idea on this to fulfill my requirement.

Example: myLog.log , myLog.log.1, ........ myLog.log.50


Regards,
Reddy
Reply | Threaded
Open this post in threaded view
|

Re: Configure RollingFileAppender to keep a back up of Fifty log files in Logback

diroussel
Please see http://logback.qos.ch/manual/appenders.html#RollingFileAppender

That should give you all the information you need.  If that is not clear, please ask.

Thanks

David

On 18 Jul 2013, at 11:09, Govardhana <[hidden email]> wrote:

Hi,

I have used *RollingFileAppender *in logback Configuration file.  My
requirement is to keep 50 log files [ maxIndex ]as back up.

Please give me some idea on this to fulfill my requirement.

Example: myLog.log , myLog.log.1, ........ myLog.log.50


Regards,
Reddy




--
View this message in context: http://logback.10977.n7.nabble.com/Configure-RollingFileAppender-to-keep-a-back-up-of-Fifty-log-files-in-Logback-tp12701.html
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user


_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user
Reply | Threaded
Open this post in threaded view
|

Re: Configure RollingFileAppender to keep a back up of Fifty log files in Logback

Govardhana

Hi David,

Have referred the above link which you mentioned but i am not able to get the exact information  which i am looking for.

I have used "FixedWindowRollingPolicy", and this supports up to 13 log files, after that it is rolls over the existing files

Below is my configuration:

        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>myLog.log.%i</FileNamePattern>
            <maxIndex>50</maxIndex>
        </rollingPolicy>

Note: Log file name pattern should be myLog.log.1.

Regards,
Reddy
Reply | Threaded
Open this post in threaded view
|

Re: Configure RollingFileAppender to keep a back up of Fifty log files in Logback

diroussel
Have a look at this: http://jira.qos.ch/browse/LOGBACK-266

In particular Ceki's last comment.  

Try using SizeAndTimeBasedFNATP instead

_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user
Reply | Threaded
Open this post in threaded view
|

Re: Configure RollingFileAppender to keep a back up of Fifty log files in Logback

Wu, Jun 2
In reply to this post by Govardhana
Hi Reddy,

 can you change your configuration as below:
  <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
     <FileNamePattern>myLog.%i.log</FileNamePattern>
     <minIndex>1</minIndex>
     <maxIndex>30</maxIndex>
  </rollingPolicy>


Regards,

Jun Wu| Senior Developer| Web Services Department | Deposit Products and Business Banking Technology | CIBC
(416)-780-5042 | [hidden email]

This email message and any attachments are CONFIDENTIAL. If you have received this message in error, please notify us immediately by return email and delete this message and any attachments without disclosing or distributing them further. Thank you.
Ce courriel, ainsi que toute pièce jointe, est CONFIDENTIEL. Si vous avez reçu ce message par erreur, veuillez nous en aviser surle-champ en nous le renvoyant et le supprimer, ainsi que toute pièce jointe, sans en avoir divulgué ou diffusé le contenu. Merci.


-----Original Message-----
From: Logback-user [mailto:[hidden email]] On Behalf Of Govardhana
Sent: Thursday, July 18, 2013 7:25 AM
To: [hidden email]
Subject: Re: [logback-user] Configure RollingFileAppender to keep a back up of Fifty log files in Logback


Hi David,

Have referred the above link which you mentioned but i am not able to get the exact information  which i am looking for.

I have used "FixedWindowRollingPolicy", and this supports up to 13 log files, after that it is rolls over the existing files

Below is my configuration:

        <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>myLog.log.%i</FileNamePattern>
           * <maxIndex>50</maxIndex>*
        </rollingPolicy>

Note: Log file name pattern should be myLog.log.1.

Regards,
Reddy



--
View this message in context: http://logback.10977.n7.nabble.com/Configure-RollingFileAppender-to-keep-a-back-up-of-Fifty-log-files-in-Logback-tp12701p12703.html
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user
Reply | Threaded
Open this post in threaded view
|

Re: Configure RollingFileAppender to keep a back up of Fifty log files in Logback

Wu, Jun 2
Hi Reddy,

You can use your file name pattern: myLog.log.%i

But make sure you have configure triggering policy


Regards,

Jun Wu| Senior Developer| Web Services Department | Deposit Products and Business Banking Technology | CIBC
(416)-780-5042 | [hidden email]

This email message and any attachments are CONFIDENTIAL. If you have received this message in error, please notify us immediately by return email and delete this message and any attachments without disclosing or distributing them further. Thank you.
Ce courriel, ainsi que toute pièce jointe, est CONFIDENTIEL. Si vous avez reçu ce message par erreur, veuillez nous en aviser surle-champ en nous le renvoyant et le supprimer, ainsi que toute pièce jointe, sans en avoir divulgué ou diffusé le contenu. Merci.


-----Original Message-----
From: Logback-user [mailto:[hidden email]] On Behalf Of Wu, Jun 2
Sent: Thursday, July 18, 2013 9:04 AM
To: logback users list
Subject: Re: [logback-user] Configure RollingFileAppender to keep a back up of Fifty log files in Logback

Hi Reddy,

 can you change your configuration as below:
  <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
     <FileNamePattern>myLog.%i.log</FileNamePattern>
     <minIndex>1</minIndex>
     <maxIndex>30</maxIndex>
  </rollingPolicy>


Regards,

Jun Wu| Senior Developer| Web Services Department | Deposit Products and Business Banking Technology | CIBC
(416)-780-5042 | [hidden email]

This email message and any attachments are CONFIDENTIAL. If you have received this message in error, please notify us immediately by return email and delete this message and any attachments without disclosing or distributing them further. Thank you.
Ce courriel, ainsi que toute pièce jointe, est CONFIDENTIEL. Si vous avez reçu ce message par erreur, veuillez nous en aviser surle-champ en nous le renvoyant et le supprimer, ainsi que toute pièce jointe, sans en avoir divulgué ou diffusé le contenu. Merci.


-----Original Message-----
From: Logback-user [mailto:[hidden email]] On Behalf Of Govardhana
Sent: Thursday, July 18, 2013 7:25 AM
To: [hidden email]
Subject: Re: [logback-user] Configure RollingFileAppender to keep a back up of Fifty log files in Logback


Hi David,

Have referred the above link which you mentioned but i am not able to get the exact information  which i am looking for.

I have used "FixedWindowRollingPolicy", and this supports up to 13 log files, after that it is rolls over the existing files

Below is my configuration:

        <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>myLog.log.%i</FileNamePattern>
           * <maxIndex>50</maxIndex>*
        </rollingPolicy>

Note: Log file name pattern should be myLog.log.1.

Regards,
Reddy



--
View this message in context: http://logback.10977.n7.nabble.com/Configure-RollingFileAppender-to-keep-a-back-up-of-Fifty-log-files-in-Logback-tp12701p12703.html
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/logback-user