Cert++
Close

Debug logs and trace flags for storefront Apex transactions

Key Takeaway

A class trace flag on a storefront Apex class doesn't create a log by itself. Logging must already be enabled, for example by a user trace flag on the user who runs the request.

A debug log is a record of what happened during a transaction, such as whether it succeeded and how long it took. You read debug logs to diagnose problems in your org, such as a failing Apex class behind a storefront. Trace flags control logging: each one names what to trace, a time window, and a debug level that sets how much detail each log category captures.

Trace flags and debug levels

A trace flag turns on and tunes logging. How much detail a debug log contains depends on the filters set by your trace flags.

Each trace flag has a debug level, a start time, an end time, and a log type. The log type specifies the entity you trace: a user, an Apex class, or an Apex trigger.

You can reuse one debug level across many trace flags, but deleting a debug level deletes all trace flags that use it.

The "Debug Levels" page in Setup is only available in Salesforce Classic. As an alternative, change debug levels from the Developer Console or query the DebugLevel object with Tooling API.

Salesforce Accredited B2B Commerce Developer Professional Study Guide

Checklist progress

0/124Learned

Troubleshoot the B2B Commerce system using available tools

0/22

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Salesforce Accredited B2B Commerce Developer Professional studiers.