platform-apex-logs-debug

Analyze Salesforce Apex debug logs to diagnose governor limits, exceptions, and performance bottlenecks.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill platform-apex-logs-debug-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: platform-apex-logs-debug
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/platform-apex-logs-debug
Command: npx skills add https://github.com/padjei/SF_Build --skill platform-apex-logs-debug-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Salesforce debug logs are dense and hard to interpret, making it difficult to find the root cause of governor limit failures, exceptions, and slow transactions. This Skill turns raw log evidence into a structured diagnosis with severity classification and concrete fix recommendations. ## Core Features & Use Cases - Governor Limit Diagnosis: Detects SOQL, DML, CPU, and heap limit consumption from LIMIT_USAGE events, with sync vs async threshold awareness. - Pattern Detection: Identifies SOQL-in-loop, DML-in-loop, non-selective queries, and null pointer exceptions from log event signatures. - Structured Reporting: Produces a six-field report (what, where, why, severity, fix, verification) scored against a 100-point rubric. - Use Case: A trigger fails in production with 'Too many SOQL queries: 101'. Retrieve the log with sf CLI, and the Skill traces the repeating SOQL_EXECUTE_BEGIN events back to the loop in AccountTriggerHandler, classifies it as Critical, and recommends a Map-based bulk query fix. ## Quick Start Ask the AI to analyze the latest debug log from your Salesforce org for governor limit issues and root causes.

Frequently Asked Questions about platform-apex-logs-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze a Salesforce debug log for governor limit issues?▼

Retrieve the log with sf apex get log or sf apex tail log, then examine LIMIT_USAGE events for SOQL, DML, CPU, and heap consumption. The Skill flags usage above 80% as warnings and 95% as critical, and traces the events back to the responsible code path.

How to detect SOQL in loop from Apex debug logs?▼

Look for repeating SOQL_EXECUTE_BEGIN events with the same line number inside LOOP_BEGIN/ITERATION blocks. The fix is to query once before the loop and store results in a Map<Id, SObject> for constant-time lookups.

What Salesforce CLI commands retrieve debug logs?▼

Use sf apex list log to see recent logs, sf apex get log --log-id to download a specific log, and sf apex tail log --color to stream logs in real time. Trace flags must be active for the target user before logs are generated.

Why is my Salesforce debug log truncated or missing?▼

Logs over 2 MB are truncated, so reduce debug levels such as ApexCode to INFO and ApexProfiling to FINE, then re-capture. If no logs appear, verify the TraceFlag ExpirationDate is in the future and the correct user is traced.

When should I use log analysis instead of running Apex tests?▼

Use log analysis when you need root-cause diagnosis from production or sandbox transaction evidence, such as exceptions, limit failures, or slow queries. Test execution and code fixes are delegated to separate test-run and code-generation skills.