Open the Developer Console, set the right log levels, reproduce the failing action, and read the resulting System Log to find the root cause.
- Open the Developer Console
Setup, Developer Console (or the gear icon, Developer Console). The console opens in a new window with several tabs at the bottom.
- Open the Logs panel
Click the Logs tab at the bottom. The panel lists recent logs for your user, sorted descending by timestamp.
- Set log levels
Debug, Change Log Levels. For most debugging, set Apex Code to FINEST, Apex Profiling to FINEST, Database to FINEST, and the rest to INFO. Save.
- Reproduce the failure
Take the action that triggers the bug: save the record, run the report, click the Lightning button. The platform captures the log automatically and appends it to the Logs panel.
- Open the log
Double-click the new log row. The System Log opens with the captured execution. Tabs at the top let you switch between Raw Log, Execution Tree, and Limits views.
- Read the LIMIT_USAGE_FOR_NS block
Scroll to the bottom of the Raw Log. Find the LIMIT_USAGE_FOR_NS block. Note the dominant counter, then trace back to the line that drove it up. That line is your starting point for the fix.
Per-category setting (NONE through FINEST). Higher levels produce more detail but consume the 250 MB cap faster.
Time-boxed log directive scoped to a user, class, or trigger. Expires automatically; renew if a longer investigation is needed.
Hierarchical view of method calls with timing and limit usage per branch. Best view for performance work.
Programmatic access to captured logs. Used for export to external observability tools.
- The 250 MB per-user log cap rolls over silently. If you reproduce a bug at high log levels and then run other work, the original log can be overwritten before you save it.
- Trace flags expire in 24 hours. A long investigation needs renewed flags or you stop capturing logs at the wrong moment.
- System.debug calls left in production code cost CPU time and inflate logs. Remove them before deploying or wrap them in a logging utility that respects an org-level flag.
- Log levels too high (FINEST everywhere) make the log unreadable and can themselves push the transaction over the 10-second CPU limit. Use FINEST only on the category you are investigating.