Debug Logs in Salesforce – EXPLAINED

A debug log is the tool every Developer uses to resolve bugs, issues, and provide fixes as soon as possible. The information contained in the Debug Logs helps identifying stack traces, root cause, system usage, and a lot of other information like:

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

Every time an API call or a transition occurs, a debug log is created
However, Formula field evaluations are not part of the debug logs.

To provide the relevant and latest information in the logs, older logs are deleted/truncated as and when needed. If a debug log exceeds 20 MB size, this truncation takes place. This could mean truncation of the System.debug statements in some cases. Although, there are exceptions. Sensitive log information mentioned below are not truncated:

The following events are necessary for processing the debug log, so they’re not deleted during truncation.

  • EXECUTION_STARTED
  • EXECUTION_FINISHED
  • CODE_UNIT_STARTED
  • CODE_UNIT_FINISHED
  • METHOD_ENTRY
  • METHOD_EXIT
  • CONSTRUCTOR_ENTRY
  • CONSTRUCTOR_EXIT
  • SOQL_EXECUTE_BEGIN
  • SOQL_EXECUTE_END
  • SOSL_EXECUTE_BEGIN
  • SOSL_EXECUTE_END
  • CALLOUT_REQUEST
  • CALLOUT_RESPONSE
  • FATAL_ERROR
« »