Support Article
How to Configure Automatic Purging of Logs
SA-8303
Summary
Instruction to purge log files automatically after certain amount of time in PRPC 5.5 SP1.
Resolution
There is no functionality included for this in PRPC 5.5 SP1. This is first introduced with PRPC 7.1.7.
Following are the two suggestions that can be helpful:
1. Use RollingFileAppender and specify values for MaxFileSize and MaxBackupIndex parameters, which purges older logs.
However, as the logs are rolled based on size, this might result in inconsistent duration of time.
2. Use DailyRollingFileAppender to roll the logs based on time (such as daily or weekly) and utilize tools outside of PRPC to purge older files.
Following is an example of how prlogging.xml must be configured for option 1:
<appender name="PEGA" class="com.pega.apache.log4j.RollingFileAppender">
<param name="File" value="PegaRULES.log"/>
<param name="MaxFileSize" value="100MB"/>
<param name="MaxBackupIndex" value="3"/>
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} [%20.20t] (%30.30c{3}) %-5p - %m%n"/>
</layout>
</appender>
The above example generate log files: PegaRULES.log, PegaRULES.log.1, PegaRULES.log.2, and PegaRULES.log.3 (three backups and one active log file). The log file with no number contains the latest log entries. In the example above, the oldest entries is present in 'PegaRULES.log.3' log file.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.