Skip to main content
close Search
Close search

Challenge

Reviewing log files

2 Tasks

15 mins

Visible to all users
Beginner Pega Platform 8.2 English

Scenario

You have been asked to examine the log files for errors generated by the HRApps application. To practice reading the log files, create a test message and add the message to the PEGA log.

The following table provides the credentials you need to complete the exercise.

Role Operator ID Password
Senior System Architect SSA@TGB rules

Your assignment

Create an activity that uses the Log-Message method to write a message to the PegaRULES log file. Apply the activity to the Identify_Employee_0 flow action for the EmployeeEvaluation case type as a post-processing action. Then, view the log file generated by the Pega server to locate your message.

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Create an activity to add a message to the log file

  1. In the EmployeeEvaluation class, create an activity record named WriteToLog.

    To create an activity record, in the Application Explorer, right-click the class name and select Create > Technical > Activity.
  2. In the first step of the activity, in the Method field, select Log-Message.
  3. Expand the method parameters.
  4. In the Message field, enter "Test message".
  5. In the LoggingLevel field, enter InfoForced.

    By default, the PegaRULES log only records messages with the logging level set to Error. Setting the level to InfoForced overrides this limitation without changing the logging level setting for the server.
    activity log
  6. Save the activity.

    Justify the warnings before check-in, as activity is the only rule type to write error message in the log file.
  7. In the Employee Evaluation class, open the IdentifyEmployee_0 flow action.

    Flow action records are located in the Process category in the Application Explorer.
  8. Click the Action tab.
  9. In the Post-processing section of the Action tab, in the Run activity field, enter or select WriteToLog to add your activity to the flow action as a post-processing action.
  10. Save the flow action to commit your configuration change.
  11. Create a new Employee Evaluation case and complete the Identify Employee form to generate an entry in the PEGA log.

2 Confirm your work

  1. In Dev Studio, select Configure > System > Operations > Logs to open the System: Operations landing page.
  2. Under Log utilities, click Log files. The log viewer opens in a new browser window, listing the log files written by your server.
  3. Under File (click to view), click the log file for the PEGA Appender File to open the log within the window.

    For security reasons, the option to download log files is not available in your exercise environment.
  4. In the log file, locate the most recent entry. Confirm that the entry matches the logging level and message from the activity you created earlier in the exercise.

    log file
    If your log file lists more than one entry, locate the entry with the most recent timestamp.
  5. Click Options to view the display options for the log file.
  6. Clear the contents of the Filter by field to display all log events.

    log viewers
  7. Click Apply to refresh the contents of the log viewer.
  8. Above the Options link, click the last page of results and locate your message.
  9. Close the window containing the log file.
  10. Return to the IdentifyEmployee_0 flow action and remove the activity from the Post-processing section of the Actions tab.
  11. Save the flow action to prevent the application from writing your test message to the PEGA log.

    To reduce clutter in the Pega log and improve performance, remove activity steps that write InfoForced level messages or convert them to comments when the message is no longer needed.

If you are having problems with your training, contact Pega Academy technical support.

Did you find this content helpful?

Want to help us improve this content?

Suggest an edit

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice