Print Pega Activity Steps in Logs

Debugging Activities in Pega can sometimes be difficult, especially when:

  • Multiple steps are executed
  • Activities call other activities
  • Parameters change dynamically
  • Errors occur intermittently

One of the easiest ways to trace Activity execution is by enabling the internal Activity logger.

This approach allows you to print:

  • Activity step execution
  • Method calls
  • Step transitions
  • Runtime processing details

directly into the Pega logs.


Use Case

Suppose you want to debug:

  • Why an activity is failing
  • Which step is executing
  • Whether a transition condition is working
  • How parameters are flowing

Instead of manually adding logs in every step, you can enable the built-in Activity logger.


Steps to Enable Activity Step Logging


Step 1: Open the Activity- Navigate to the Activity rule you want to debug.

Step 2: Open the Activity XML - Inside the Activity rule:- Click on Actions /Select:View XML

Step 3: Search for "Log-Helper"

    Inside the XML, search for: Log-Helper

Step 4: Copy the Logger Name

    Copy the complete logger entry from the XML.

Step 5: Add Logger in Logging Level Settings

  • Open Admin Studio
  • Navigate to:
    Resources → Logging Level Settings

Step 6: Add the Logger

Add the copied logger name.

Configure:

  • Logging Level = ALL
  • Duration = 2 Hours
Step 7: Save the Logger Configuration

Save the logger settings.

The logger becomes active immediately.

Step 8: Execute the Activity

Run the activity again from:

  • Case processing
  • Activity test page
  • Flow action
  • Job scheduler
  • Queue processor
Step 9: Check the Logs

Open:

  • PegaRULES log

You will now see detailed activity step execution logs.

Example output:

Activity MyActivity Step 1 Method Obj-Open
Activity MyActivity Step 2 Method Property-Set
Activity MyActivity Step 3 Transition Executed

Benefits of This Approach

Using the Activity logger helps:

  • Troubleshoot activity execution
  • Identify failing steps
  • Debug transition logic
  • Trace parameter values
  • Understand execution flow
without modifying the activity itself.

Conclusion

Enabling internal Activity loggers is a quick and powerful way to trace Pega Activity execution without modifying existing rules.

Post a Comment