Salesforce Log Subscriber
Overview
The Salesforce Log Subscriber is a powerful Visual Studio Code extension that allows users to manage logs and trace flags in a Salesforce organization, directly from the Visual Studio Code interface. It utilizes the Salesforce CLI under the hood to interact with your Salesforce organization, giving developers a streamlined and integrated environment for Salesforce log management.
Features
Core Features
- Fetch and delete logs from Salesforce
- Handle Salesforce trace flags, including fetching users and Apex Classes from Salesforce, creating and deleting trace flags
- Display Salesforce logs and trace flags in a tree view
- Quick debug log setup for current user for 30 minutes with given debug level
New in v1.0.0
Real-Time Log Streaming
Stream debug logs as they are generated in your Salesforce org. No more manual refreshing!
- Start/stop streaming with a single click or keyboard shortcut (
Ctrl+Shift+L / Cmd+Shift+L)
- Auto-refresh log tree when new logs arrive
- Status bar indicator shows streaming status
- Configurable polling interval
- Filter streaming to current user or all users
Log Filtering Panel
Powerful filtering and search capabilities for debug logs:
- Filter by event type:
USER_DEBUG, SOQL, DML, EXCEPTION, LIMITS, FLOW, CALLOUT
- Custom regex pattern search
- Click any filtered line to jump to that location in the log
- Export filtered results
- Color-coded event types for easy identification
- Keyboard shortcut:
Ctrl+Shift+F / Cmd+Shift+F (when viewing a .log file)
Governor Limits Dashboard
Visualize and analyze governor limit consumption:
- Visual progress bars showing limit usage (green/yellow/red indicators)
- Track: CPU Time, Heap Size, SOQL Queries, DML Statements, Callouts, and more
- SOQL Query breakdown with row counts and aggregations
- DML Operations summary with object types and row counts
- Click to navigate directly to the relevant log line
- Keyboard shortcut:
Ctrl+Shift+G / Cmd+Shift+G (when viewing a .log file)
Installation
- Install Visual Studio Code
- Install Salesforce CLI
- Install this extension from the Visual Studio Code extension marketplace
How to Use
Log Utilities
- Delete Logs: Deletes all logs in the Salesforce organization
- Fetch Logs: Fetches all available logs from the Salesforce organization
- Setup Quick Log: Adds a quick debug log for current user for 30 minutes with given debug level
- Fetch My Logs: Fetches only current user logs based if a trace flag is active
- Fetch All Logs: Fetch all logs for all active trace flags
To use these features, access the commands from the command palette (Ctrl+Shift+P on Windows, Cmd+Shift+P on MacOS) and search for "SF Log Subscriber".
Real-Time Log Streaming
- Open the Salesforce Log Explorer in the activity bar
- Click the sync icon in the "Org's Debug Logs" panel title bar, or
- Use keyboard shortcut
Ctrl+Shift+L / Cmd+Shift+L, or
- Open command palette and search for "SF Log Subscriber: Start Log Streaming"
The streaming status is shown in the status bar. New logs will automatically appear in the log tree and output channel.
Log Filtering
- Right-click on any log in the "Org's Debug Logs" panel and select "Filter This Log", or
- Open a
.log file and click the filter icon in the editor title bar, or
- Use keyboard shortcut
Ctrl+Shift+F / Cmd+Shift+F when viewing a log file
The filter panel allows you to:
- Toggle visibility of different event types
- Enter custom regex patterns
- Click on any result to jump to that line in the log
- Export filtered results to a file
Governor Limits Dashboard
- Right-click on any log in the "Org's Debug Logs" panel and select "Analyze Governor Limits", or
- Open a
.log file and click the dashboard icon in the editor title bar, or
- Use keyboard shortcut
Ctrl+Shift+G / Cmd+Shift+G when viewing a log file
The dashboard shows:
- Limits Tab: Visual progress bars for all governor limits with percentage usage
- SOQL Queries Tab: List of all SOQL queries with row counts and aggregations
- DML Operations Tab: List of all DML operations with object types and row counts
Trace Flags
- Fetch Users: Fetches all active users from your Salesforce organization
- Fetch Debug Levels: Fetches all available Debug Levels from your Salesforce organization
- Fetch Apex Classes: Fetches all available Apex Classes from your Salesforce organization
- Delete Trace Flag: Deletes a trace flag by its ID
- Add Trace Flag: Adds a new trace flag with specific parameters (type, user, start date, end date, and debug level)
The trace flags are displayed in a tree view within VS Code. Clicking on the "Refresh" button will refresh the view.
Each trace flag can be deleted directly from the tree view.
Keyboard Shortcuts
| Command |
Windows/Linux |
macOS |
| Toggle Log Streaming |
Ctrl+Shift+L |
Cmd+Shift+L |
| Open Log Filter Panel |
Ctrl+Shift+F |
Cmd+Shift+F |
| Open Governor Limits Dashboard |
Ctrl+Shift+G |
Cmd+Shift+G |
Requirements
- Visual Studio Code v1.78.0 or higher
- Salesforce CLI installed and configured
- An authorized Salesforce org (connected via
sf org login or sfdx auth:web:login)
Contributing
We encourage you to contribute to Salesforce Log Subscriber! Please check out the Contributing Guide for guidelines about how to proceed.
Demo

License
Salesforce Log Subscriber is open-sourced software licensed under the MIT license.