Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

How to roll PegaRULES log based on size

SA-2370

Summary



How can PegaRULES.log be rolled based on its size?

Resolution



The following configuration will roll logs based on size, generating log files PegaRULES.log, PegaRULES.log.1, PegaRULES.log.2, and so on:

<appender name="PEGA" class="com.pega.apache.log4j.RollingFileAppender">
<param name="File" value="'PegaRULES.log'"/>
<param name="MaxFileSize" value="10KB"/>
<param name="MaxBackupIndex" value="10"/>
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} [%20.20t](%30.30c{3}) %-5p %X{stack} %X{userid} - %m%n"/>
</layout>
</appender>


The log file with no number will contain the latest log entries. As the number increases, the older the log entries will be. In the example above, the oldest entries will be in, "PegaRULES.log.10" once enough log files have been created to reach the tenth file.

The value of MaxFileSize can be changed to suit the requirement (100KB, 10MB, and so on). This will only create logs until the MaxBackupIndex value is reached. Once this is reached, the oldest entries will be lost.

Published November 22, 2016 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us