Debug logs require a Trace Flag and a Debug Level. Once both are in place, any transaction the targeted user runs (or any transaction that touches the targeted entity) produces a log. The fastest path is through the Developer Console; production-grade debugging uses the Setup UI or the Tooling API.
- Open Setup, then Debug Logs
Setup, then Debug Logs. The page lists active Trace Flags and recent logs. Click New to add a Trace Flag.
- Pick the target user
For most debugging, set the Tracked Entity Type to User and the Tracked Entity Name to your own user. For multi-user troubleshooting, target the user who is hitting the bug.
- Pick or create a Debug Level
Choose an existing Debug Level (SFDC_DevConsole is a good default) or create a new one with the categories and levels you want. APEX_CODE: FINE and DB: FINEST are common starting points; raise individual categories as needed.
- Set the start and expiration time
Trace Flags expire automatically. Default duration is 30 minutes; max is 24 hours. Pick a window that covers your testing without burning storage.
- Reproduce the transaction
Run the failing process: hit a button, save a record, run an Apex job. Each transaction the user runs in the window produces a new log entry.
- Open and analyze the log
From the Debug Logs page or the Developer Console (Debug, then View Log), open the log. Search for USER_DEBUG, EXCEPTION_THROWN, or CUMULATIVE_LIMIT_USAGE to jump to the interesting parts. Download the file if you need to grep it offline.
Logs every transaction the user runs. Most common starting point for general debugging.
Logs only transactions that execute the named Apex class. Useful for narrowing high-volume logs to one component.
Logs only transactions that fire the named trigger.
Controls Apex execution detail. FINE shows method entry/exit; FINEST adds variable values and SOQL bind details.
Controls SOQL and DML detail. FINEST shows query plans and row counts.
- Logs are capped at 50 MB each. A FINEST log on a batch with 200 records can hit the cap and lose the start of the transaction. Lower the level or narrow the trace flag to a specific class.
- User Trace Flags expire automatically. If you opened a 30-minute window and the failing transaction runs at minute 31, you get no log. Check the expiration before reproducing.
- The 250 MB rolling org-wide cap is shared across all users. A noisy demo org with multiple developers logging at FINEST can suppress new logs until older ones age out.
- Logs are stored for 7 days. Anything older is gone. Download or query into Apex what you need to preserve before that window closes.