Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Developer Console entry
How-to guide

How to run a SOQL query and review a debug log in the Developer Console

The Developer Console is one of the fastest ways to run an ad-hoc SOQL query and tail debug logs. Both flows take less than a minute and require no installation.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 20, 2026

The Developer Console is one of the fastest ways to run an ad-hoc SOQL query and tail debug logs. Both flows take less than a minute and require no installation.

  1. Open the Developer Console

    Click your avatar in the upper right, then Developer Console. A new window opens with the Console UI. Some browsers block popups; allow popups for salesforce.com if the Console does not open.

  2. Run a SOQL query

    At the bottom, click the Query Editor tab. Type a SOQL query: SELECT Id, Name, Owner.Name FROM Account WHERE Industry = Technology LIMIT 10. Click Execute. Results appear in the grid; double-click a cell to edit and save.

  3. Enable a Trace Flag for debug logging

    Click Debug, then Change Log Levels. Add a User Trace Flag for your own user with the SFDC_DevConsole Debug Level for 30 minutes. Save.

  4. Reproduce the action you want to debug

    Open another tab, navigate to the record or feature, and run the operation that produces the log you need. Switch back to the Console.

  5. Open the log

    The Logs tab at the bottom of the Console shows new logs as they arrive. Double-click the latest entry. The log opens in a viewer with timeline, tree, and search controls.

  6. Search and analyze the log

    Use Ctrl+F (or Cmd+F) to find USER_DEBUG entries, EXCEPTION_THROWN events, or CUMULATIVE_LIMIT_USAGE. The Filter tab in the log viewer lets you toggle event types on and off to reduce noise.

Key options
Query Editorremember

SOQL and SOSL queries with inline results. Edit cells directly for ad-hoc data fixes.

Logs tabremember

Streaming debug logs. Double-click to open in the Console''s log viewer.

Execute Anonymous Windowremember

Run arbitrary Apex against the org. Most-used Console feature after the Query Editor.

Checkpointsremember

Debug breakpoints that capture heap dumps. Up to 5 per user, set in Apex code.

Gotchas
  • The Developer Console cannot edit Lightning Web Components. For LWC work, install VS Code and the Salesforce Extensions Pack.
  • Anonymous Apex runs as your user, with your permissions. Be careful when running data fixes: a misplaced delete in Execute Anonymous can wipe production records that your profile happens to have access to.
  • Trace Flags set from the Console expire automatically (default 30 minutes, max 24 hours). Long debugging sessions need fresh flags.
  • The Console is single-org. Switching to a different sandbox or production org requires logging out and logging into the new org first.

See the full Developer Console entry

Developer Console includes the definition, worked example, deep dive, related terms, and a quiz.