Support Article
Configuring log rotation and location
SA-10352
Summary
How do you configure log rotation and location?
Resolution
This issue is resolved through the following Local-change:
To change the default path of the generated logs to any directory outside of the server’s temp directory, make the following change in the appender definitions (as in example below) inside prlogging.xml.
From:
<appender name="PEGA" class="com.pega.pegarules.priv.util.DailySizeRollingFileAppenderPega">
<param name="FileNamePattern" value="'@{web.tmpdir}/PegaRULES-'yyyy-MMM-dd'.log'"/>
<param name="MaxFileSize" value="50MB" />
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%20.20t] [%10.10X{pegathread}] [%20.20X{tenantid}] [%20.20X{app}] (%30.30c{3}) %-5p %X{stack} %X{userid} - %m%n"/>
</layout>
</appender>
To:
<appender name="PEGA" class="com.pega.pegarules.priv.util.DailySizeRollingFileAppenderPega">
<param name="FileNamePattern" value="'/usr/pega/logs/PegaRULES-'yyyy-MMM-dd'.log'"/>
<param name="MaxFileSize" value="50MB" />
<layout class="com.pega.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%20.20t] [%10.10X{pegathread}] [%20.20X{tenantid}] [%20.20X{app}] (%30.30c{3}) %-5p %X{stack} %X{userid} - %m%n"/>
</layout>
</appender>
The above example assumes that you have already created a directory named ‘/usr/pega/logs’ in the server file system and the server process’s user id/group has read, write and execute file permissions to that directory.
Published June 12, 2015 - 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.