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 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
Save the logger settings.
The logger becomes active immediately.
Run the activity again from:
- Case processing
- Activity test page
- Flow action
- Job scheduler
- Queue processor
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

Post a Comment