How to Log a Message using Data Transform?



There are OOTB Functions in Pega to Log a Message in Pega Logs along with the specified level. Lets See how to log a message through Data Transform in Pega.

The below are the functions that can be used in Data Transform to Log a Message with the specified level.

@Default.pxLogMessage(sMessage) - Logs the message for error level in pega logs.

@Default.pxLogMessage(sMessage,cLevel) - Logs the message for specified level in pega logs.

Parameters:

sMessage - Message for Logging
cLevel - d,i,f,w,e

The character that can be passed in cLevel indicates:

d – debug
i – info
f – info Forced
w – warn
e –  error

To check the Log Messages in Pega Dev Studio follow the below path:

Dev Studio > Configure > System > Operations > Logs > Log files > PegaRULES.Log

Example:

We are going to Log a Message in PegaRULES log as infoForced & Error by using Data Transform.


To Log the Message as InfoForced : 

@(Pega-RULES:Default).pxLogMessage(param.Message,'f')



To Log the Message as Error : 

@(Pega-RULES:Default).pxLogMessage(param.Message,'e')


Happy Learning 😁!!!




Popular Posts