Use the Log-Message method to append a message to the Pega log when the step is reached. Depending on method parameters and the current logging level, a line is added to the Pega log on the current node.
Additions to the Pega log consume system resources. Select the LoggingLevel parameter carefully. For best performance, remove or convert to comments the steps containing this method when they are no longer needed.
The Log-Message method accepts four parameters:
Enter the text of the message between double quotes, or an expression that
results in a text value. For example:
The predefined Java variable myStepPage identifies the step page of the method. For example, to include the entire contents of the step page in the log as an XML document, set the Message parameter to:
You can include a linked property reference in the expression.
Optional. Enter one of the following values:
Choose a type; the default value is
Messages appear when their
or is more severe than the internal logging level setting. If you choose
If you choose
|GenerateStackTrace||Select to cause execution of this method to create a Java stack trace in the Pega log, in addition to other results. If the SendToTracer check box is selected, the stack trace also appears in the Tracer tool output.|
|SendToTracer||Select to cause a Tracer event when this method executes, in addition to other results.|
parameter is set to
a message is added to the Pega log on the current node.
parameter is set to
Error, results of this
method depend on a comparison of the
parameter with the
setting on the current node for the
class. If the value of the parameter is equal to or
greater than the severity value of the setting, the message is added to the log and other
processing occurs as described above. You can temporarily override the setting in the
file using the Set Logging Level tool. Severity levels range
(lowest level, most messages) to
If requested, a Java stack trace is also added to the Pega log. If requested, a Tracer event is generated. These events appear in Tracer output if the Log-Message check box is selected on the Tracer Settings panel.
When debugging is complete, you can delete the steps that use this method or change them to
comment steps. This is needed for steps where LoggingLevel is set to
InfoForced. For others, if the
class is higher than the
parameter, executing this method does not update the
Pega log and does not affect performance.
Checking the method status
This method updates the pxMethodStatus property. See How to test method results using a transition.
Previous topic Using the Load-DataPage method Next topic Map-Structured method