Skip to main content

Reviewing log files

1 Task

15 mins

Visible to: All users
Intermediate Pega Platform 8.8 Enterprise Application Development Performance English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

Employees undergo an evaluation period to regularly assess their performance as new hires during the employee evaluation process. To check the status of the evaluation period in the employee evaluation case type, the IsEvalPeriodEnded when rule checks if the entered evaluation date is in the past. If the user enters an end date that is in the past, the case moves to the next process of Assess employee. When the user enters an end date that is in the future, the Assessment step is skipped, and the case moves to the Review stage.

At runtime, you notice the process is not returning the expected values. Review the logs to discover the cause of this discrepancy. 

  • Create an activity that uses the Log-Message method to write a message to the PegaRULES log file only when the IsEvalPeriodEnded returns false
  • Add this activity in the Run activity field under the Actions tab in the IdentifyAssessmentPeriod_0 flow action
  • Run the case and view the log file generated to see the message "Invalid Evaluation criteria End date"+ .Enddate

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

Role User name Password
Senior System Architect SSA@TGB pega123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

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

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

Challenge Walkthrough

Detailed Tasks

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

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter SSA@TGB.
    2. In the Password field, enter pega123!.
  2. In the EmployeeEvaluation class, create an activity record named WriteToLog.

    Tip: To create an activity record, in the Application Explorer, right-click the class name and select Create > Technical > Activity.
  3. In the first step of the activity, add an Enable when condition, and then set the following values:
    • When: IsEvalPeriodEnded
    • if true: Skip Step,
    • if false: Continue Whens
      Log message activity with when condition
       
  4. In the Method field, enter or select Log-Message.
  5. In the Message field, enter "Invalid Evaluation criteria End date" + .EndDate.
  6. In the LoggingLevel field, enter InfoForced.

    Log message activity
    Note: 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.
  7. Save the activity.

    Note: Creating a new Activity prompts guardrail warnings. Justify the warnings before you check-in the record.
  8. In the Employee Evaluation class, open the IdentifyAssessmentPeriod_0 flow action.

    Tip: Flow action records are located in the Process category in the Application Explorer.
  9. Click the Action tab.
  10. On the Action tab, in the Post-processing section, in the Run activity field, enter or select WriteToLog to add your activity to the flow action as a post-processing action.
  11. Save the flow action to commit your configuration change.

Confirm your work

  1. Create a new Employee Evaluation case, complete the Identify employee form, and then submit the form.
  2. Proceed to the Identify assessment period form, and enter an end date that is in the past.
  3. Verify that the case moves to the Review assessment form instead of the Assess employee form.
    Review assessment log files
     
  4. In the header of Dev Studio, click Configure > System > Operations > Logs to open the System: Operations landing page.
  5. In the Log utilities section, click Log files to display a new browser window that lists the log files written by your server.

  6. In the File (click to view) column, click the PEGA appender file to open the log in the window.

    Note: For security reasons, the option to download log files is not available in your exercise environment. To learn how to download log files see Downloading log files and to learn how to parse an alert log see Parsing the alert log.
  7. In the log file, locate the most recent entry, and then confirm that the entry matches the logging level and message from the activity you created earlier in the exercise. This log message entry is generated only when the IsEvalPeriodEnded rule returns false:

    Log message
  8. Close the window that contains the log file.
  9. Open the IsEvalPeriodEnded when condition.
    Tip: When conditions are located in the Decision category in the Application Explorer.
  10. Change .Emddate to .Enddate and save the rule.
  11. Complete steps 1-2 and confirm that the case advances to the Assess employee view.
  12. Return to the IdentifyAssessmentPeriod_0  flow action, and on Actions tab, remove the activity from the Post-processing section.
  13. Save the flow action to prevent the application from writing your test message to the PEGA log.

    Tip: 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.
  14. Optional: Delete the EmdDate property and WriteToLog activity.


This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

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