Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Salesforce Log SubscriberNew to Visual Studio Code? Get it now.
Salesforce Log Subscriber

Salesforce Log Subscriber

nagendra080389

|
587 installs
| (0) | Free
AI-Powered Salesforce log analysis! Get instant exception explanations, stream logs in real-time, filter & analyze with Governor Limits Dashboard - all in VSCode
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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.3.0

Interactive Execution Flow Mindmap

Visualize the entire execution hierarchy of a Salesforce debug log as an interactive mindmap:

  • Visual node graph: See CODE_UNIT, METHOD, SOQL, DML, and Flow events as color-coded nodes connected by smooth curves
  • Drag nodes freely: Grab and reposition any node — connections follow automatically and never break
  • Zoom & pan: Mouse wheel to zoom, drag canvas to pan, auto-fit button
  • Exception path tracing: Red borders and red connecting lines trace the path from root to every exception
  • Loop detection: Repeated calls (e.g., 200 identical Flow interviews) collapsed into a single node with "called 200x" badge
  • Click any node to jump directly to that line in the log file
  • Smart defaults: System methods hidden by default, auto-expands to 2 levels, auto-fits to viewport
  • Filters: Hide System/Debug, category filter (Apex/SOQL/DML/Flows/Exceptions), and text search
  • Keyboard shortcut: Ctrl+Shift+E / Cmd+Shift+E (when viewing a .log file)

[Execution Flow Viewer]

New in v1.2.0

Exception-Aware Log Tree View

Instantly identify which logs contain exceptions without opening them:

  • Red bug icon for logs with exceptions - stands out from normal file-code icons
  • Exception type shown in description - e.g., NullPointerException, LimitException
  • Three-layer detection:
    • SOQL Status field catches fatal/unhandled exceptions (zero extra API cost)
    • Body scan detects EXCEPTION_THROWN / FATAL_ERROR patterns in cached logs
    • Body scan detects caught exceptions in try-catch blocks (via VARIABLE_ASSIGNMENT patterns)
  • Auto-updates: When you download a log, the tree refreshes to show exception status from body scan
  • Streaming alerts: New logs with exceptions show [EXCEPTION] in the output channel with a warning notification

Group Logs by Request

Group debug logs by their Salesforce RequestIdentifier to see which logs belong to the same request:

  • Toggle button (list-tree icon) in the "Org's Debug Logs" title bar to switch between flat and grouped views
  • Collapsible groups: Multi-log requests show as expandable groups with summary (operation, log count, total size)
  • Single-log requests stay flat — no unnecessary wrapper, fewer clicks
  • RequestIdentifier shown in description when grouped view is active (e.g., TID:30154429..)
  • Full RequestIdentifier in tooltip — hover over any log to see the complete value

[Group By Viewer]

New in v1.1.0

🤖 AI-Powered Exception Explainer (Hero Feature!)

Get instant, intelligent explanations for exceptions and errors directly in VS Code:

  • Click on any exception line and get AI-powered analysis with root cause explanation
  • Receive actionable fix suggestions specific to Salesforce best practices
  • Analyze full logs to identify all issues and get comprehensive recommendations
  • Choose your analysis depth: Standard (fast, focused) or Deep (comprehensive with full execution flow)
  • Cost transparency: See estimated costs before running analysis
  • Keyboard shortcut: Ctrl+Shift+A / Cmd+Shift+A (when viewing a .log file)

First AI-powered log analysis extension for Salesforce!

🔌 Multi-LLM Support - Choose Your AI Provider!

This extension supports 5 different AI providers, giving you flexibility based on your needs:

Provider Model Best For
Claude claude-3-5-sonnet Highest quality analysis
OpenAI gpt-4o Fast, accurate, widely available
Google Gemini gemini-2.5-flash Free tier, very low cost
Ollama llama3.2 100% local & private, no API costs
Salesforce Einstein Multiple models Agentforce orgs, data stays in Salesforce

🏢 Salesforce Einstein Integration (For Agentforce-Enabled Orgs)

Great news for enterprise Salesforce customers! If your org has Agentforce enabled, you can use Salesforce's own AI models for log analysis:

  • Data Privacy: Your log data stays within the Salesforce ecosystem - never leaves to third-party AI providers
  • No External API Keys: Uses your existing Salesforce credentials via secure JWT authentication
  • Multiple Models Available:
    • sfdc_ai__DefaultBedrockAnthropicClaude4Sonnet
    • sfdc_ai__DefaultBedrockAnthropicClaude45Sonnet
    • sfdc_ai__DefaultOpenAIGPT4Omni
    • sfdc_ai__DefaultGoogleGemini20Flash
    • And more...
  • Cost: Uses your org's Agentforce credits allocation

Setup: Create an External Client App or Connected App with Client Credentials Flow enabled, then configure Client ID and Client Secret in extension settings.

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

  1. Install Visual Studio Code
  2. Install Salesforce CLI
  3. Install this extension from the Visual Studio Code extension marketplace
  4. (Optional) Configure an AI provider for AI-powered features:
    • OpenAI (GPT-4o) - Recommended
    • Google Gemini - Free tier, very low cost
    • Claude - Highest quality
    • Ollama - 100% local & private
    • Salesforce Einstein - For Agentforce-enabled orgs (no external API needed!)

How to Use

AI Exception Explainer

Setup - Choose Your AI Provider

Option 1: OpenAI (GPT-4o) - Recommended for most users

  1. Open VS Code Settings (Ctrl+, or Cmd+,)
  2. Search for "Salesforce Log Subscriber"
  3. Set "AI Provider" to OpenAI
  4. Get API key at https://platform.openai.com/api-keys
  5. Paste into "OpenAI API Key" field
  6. Uses model: gpt-4o

Option 2: Google Gemini 2.5 - Free tier available, very low cost

  1. Set "AI Provider" to Gemini
  2. Get API key at https://aistudio.google.com/apikey
  3. Paste into "Gemini API Key" field
  4. Uses model: gemini-2.5-flash

Option 3: Claude (Anthropic) - Highest quality analysis

  1. Set "AI Provider" to Claude
  2. Get API key at https://console.anthropic.com/
  3. Paste into "Claude API Key" field

Option 4: Ollama (Local) - 100% Private, Free

  1. Set "AI Provider" to Ollama
  2. Install Ollama from https://ollama.com/
  3. Run: ollama pull llama3.2
  4. Run: ollama serve

Option 5: Salesforce Einstein - For Agentforce-Enabled Orgs (Data stays in Salesforce!)

  1. Set "AI Provider" to Einstein
  2. Create an External Client App or Connected App in your Salesforce org:
    • Enable Client Credentials Flow
    • Add OAuth scopes: api, sfap_api
    • Generate Client Secret
  3. Copy the Consumer Key (Client ID) and Consumer Secret from the app
  4. Paste into extension settings:
    • "Einstein Client Id" field
    • "Einstein Client Secret" field
  5. Select your preferred Einstein model in "Einstein Model" setting

Why choose Einstein?

  • Your log data never leaves the Salesforce ecosystem
  • Uses secure JWT authentication (Client Credentials Flow)
  • Leverages your existing Agentforce entitlements
  • Ideal for organizations with strict data privacy requirements

Using AI Analysis

  1. Explain a specific exception:

    • Open any .log file
    • Place cursor on an exception line
    • Use command palette: "SF Log Subscriber: Explain This Exception with AI"
    • Or use keyboard shortcut: Ctrl+Shift+A / Cmd+Shift+A
  2. Analyze full log:

    • Open any .log file
    • Click the AI sparkle icon (✨) in the editor title bar, or
    • Use command palette: "SF Log Subscriber: AI: Analyze Full Log"

The AI will provide:

  • Clear explanation of what caused the exception
  • Root cause analysis from log context
  • Actionable fix suggestions following Salesforce best practices
  • Links to relevant documentation
  • Governor limit implications if applicable

Supported AI Providers:

  • ✅ OpenAI (GPT-4o) - Fast, accurate, widely available
  • ✅ Google Gemini 2.5 - Free tier, very low cost
  • ✅ Claude 3.5 Sonnet - Highest quality analysis
  • ✅ Ollama (Local) - 100% private, no API costs
  • ✅ Salesforce Einstein - Data stays in Salesforce, uses Agentforce credits

Privacy Options:

  • Ollama: 100% local processing - no data leaves your machine
  • Salesforce Einstein: Data stays within Salesforce ecosystem - ideal for enterprise privacy requirements

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

  1. Open the Salesforce Log Explorer in the activity bar
  2. Click the sync icon in the "Org's Debug Logs" panel title bar, or
  3. Use keyboard shortcut Ctrl+Shift+L / Cmd+Shift+L, or
  4. 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

  1. Right-click on any log in the "Org's Debug Logs" panel and select "Filter This Log", or
  2. Open a .log file and click the filter icon in the editor title bar, or
  3. 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

Execution Flow Viewer

  1. Right-click on any log in the "Org's Debug Logs" panel and select "View Execution Flow", or
  2. Open a .log file and click the type-hierarchy icon in the editor title bar, or
  3. Use keyboard shortcut Ctrl+Shift+E / Cmd+Shift+E when viewing a log file

The mindmap shows:

  • Nodes: Each execution event (method call, SOQL query, DML operation, Flow) as a colored rectangle
  • Connections: Smooth curved lines showing parent-child call hierarchy
  • Interaction: Drag nodes, zoom with mouse wheel, pan by dragging canvas, click nodes to jump to log lines
  • Loops: Repeated identical calls shown as one node with "called Nx" badge
  • Exceptions: Red-bordered nodes with red path tracing back to root

Governor Limits Dashboard

  1. Right-click on any log in the "Org's Debug Logs" panel and select "Analyze Governor Limits", or
  2. Open a .log file and click the dashboard icon in the editor title bar, or
  3. 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
AI: Analyze Full Log Ctrl+Shift+A Cmd+Shift+A
View Execution Flow Ctrl+Shift+E Cmd+Shift+E

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

Watch the demo video

License

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft