Cert++
Close

Debug logs for transaction and automation troubleshooting

Key Takeaway

To capture a user's transactions in a debug log, put a trace flag on the user who runs them. An Apex class or trigger trace flag doesn't create logs by itself, and public site visitors run as the site's guest user, so the guest user is the one to trace.

A debug log is a record of what Salesforce did during a transaction, such as database changes, automation that ran, Apex errors, and HTTP callouts. Admins read debug logs to find out why a save or an automated process behaved the way it did. You decide when logs are captured, and how much detail they hold, by setting trace flags and debug levels.

What a debug log records

A debug log records the database operations, system processes, and errors that happen while a transaction runs or while unit tests run. For each transaction, the log shows details such as whether the transaction succeeded and how long it took.

A log can include these kinds of information:

  • Database changes
  • HTTP callouts
  • Apex errors
  • Resources used by Apex
  • Automated processes, such as:
    • Workflow rules
    • Assignment rules
    • Approval processes
    • Validation rules

The transactions in a log can come from the Salesforce user interface, the API, executeanonymous calls, web services, or email services.

Debug logs leave out some activity. They don't include actions triggered by time-based workflows. They also don't include transactions that lead conversion triggers, so if a converted lead fires a workflow rule, the log doesn't show that the rule fired.

Platform Administrator II Study Guide

Checklist progress

0/290Learned

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Platform Administrator II studiers. 757 members and growing.