Support Article
Pega logs and Pega Alerts do not display output as JSON files
SA-52571
Summary
The Pega logs and Pega Alerts do not display the output as JSON files.
Error Messages
Not Applicable
Steps to Reproduce
Unknown
Root Cause
An issue in the custom application code or rules
The appender to the root logger in the prlog4j2.xml file is configured incorrectly.
Resolution
Perform the following local-change:
<Configuration status="warn">
<Appenders>
---------------------
---------------------
<RollingRandomAccessFile name="PEGAJSON" fileName="${sys:pega.tmpdir}/PegaRULES.json.log" filePattern="${sys:pega.tmpdir}/PegaRULES-%d{MM-dd-yyyy}-%i.json.log.gz">
<JSONLayout />
<Filters>
<!--Deny message logged under ALERT log level-->
<ThresholdFilter level="ALERT" onMatch="DENY" onMismatch="NEUTRAL"/>
</Filters>
<Policies>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="250 MB"/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="ALERTJSON" fileName="${sys:pega.tmpdir}/PegaAlert.json.log" filePattern="${sys:pega.tmpdir}/PegaAlert-%d{MM-dd-yyyy}-%i.json.log.gz">
<JSONLayout />
<ThreadContextMapFilter onMatch="DENY" onMismatch="NEUTRAL" operator="or">
<KeyValuePair key="alertType" value="security"/>
</ThreadContextMapFilter>
<Policies>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="250 MB"/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
----------------------
----------------------
</Appenders>
<Loggers>
<asyncRoot>
----------------------
----------------------
<AppenderRef ref="PEGAJSON"/>
<AppenderRef ref="ALERTJSON" level="ALERT"/>
</asyncRoot>
</Loggers>
</Configuration>
Published May 15, 2018 - 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.