Newer Version Available
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 your scratch org. You can use the Salesforce
CLI to view the debug logs.
- Open your scratch org by running force:org:open. If you have not set a default username, specify the scratch org’s username or alias with the -u parameter.
- Under the quick access menu (Lightning Experience) or your name (Salesforce Classic), click Developer Console. Opening the Developer Console starts a listener that is required by the force:apex:log commands.
-
If necessary, run Apex tests to generate some debug logs.
-
Get a list of the debug logs.
-
View a debug log by passing its ID to the force:apex:log:get command.