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

DailyRollingFileAppender_Not working for CMG Logging

SA-40413

Summary



User wants to create the new daily rolling pattern.

Configuration in prlogging.xml with DailyRollingFileAppender is not generating backup log files correctly.

Below is the configuration details:

<appender class="com.pega.apache.log4j.DailyRollingFileAppender" name="PEGA">
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="File" value="'/yourpath/PegaRULES.log'"/>
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%p] [%d{yyyy/MM/dd HH:mm:ss,SSS}] [%t] [%X{tenantid}] [%X{app}] [%c{3}] [%X{stack}] [%X{userid}] [%m]%n"/>
</layout>
</appender>


Error Messages



Not Applicable


Steps to Reproduce



1.Open prlogging.xml
2. Edit the appender name with "PEGA" as below:

<appender class="com.pega.apache.log4j.DailyRollingFileAppender" name="PEGA">
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="File" value="'/yourpath/PegaRULES.log'"/>
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%p] [%d{yyyy/MM/dd HH:mm:ss,SSS}] [%t] [%X{tenantid}] [%X{app}] [%c{3}] [%X{stack}] [%X{userid}] [%m]%n"/>
</layout>
</appender>


Root Cause



A software use or operation error : User configuration fault.

Resolution



Perform the following local-change:

​The single quotes (') characters in the param "File" is causing the behavior.

Change the configuration as mentioned below to resolve the issue:

<appender class="com.pega.apache.log4j.DailyRollingFileAppender" name="PEGA">
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="File" value="/yourpath/PegaRULES.log"/>
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%p] [%d{yyyy/MM/dd HH:mm:ss,SSS}] [%t] [%X{tenantid}] [%X{app}] [%c{3}] [%X{stack}] [%X{userid}] [%m]%n"/>
</layout>
</appender>


After implementing the above configuration, the logs get rolled out as expected for the date change.

Old log files got appended with date and new logs will be stored into PegaRules-.log file. Below is the screen print of logs folder.





Published September 20, 2017 - Updated October 8, 2020

Was this useful?

0% 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