Newer Version Available

This content describes an older version of this product. View Latest

Generate and View Apex Debug Logs

Apex debug logs can record database operations, system processes, and errors that occur when executing a transaction or running unit tests in any authenticated org. Enable the Debug Log in Salesforce Extensions for VS Code, then view the logs with VS Code or Salesforce CLI.
  1. In Salesforce Extensions for VS Code, prepare the org to generate logs and configure the debugger.
    1. Log in to the org.
    2. For Replay Debugger, run SFDX: Turn on Apex Debug Log for Replay Debugger.
    3. Create a launch configuration file for Replay Debugger or Interactive Debugger.
  2. After you run the tests, get a list of the debug logs.
  3. View a debug log by passing its ID to the apex get log command.