Salesforce Debug Log Analysis
Salesforce debug logs look like text but behave like event traces from a distributed system. A single record update can produce tens of thousands of lines across dozens of triggers, flows, LWC controllers, rollup calculations, validation rules, workflow field updates, platform events, and managed packages. The real cause is often in a different transaction than the one the user uploaded, or inside a package whose source you cannot read. This skill captures the complete investigation pattern for every type of Salesforce runtime behavior.
Recommended Workflow
For any Salesforce log, follow this loop in order. Do not skip steps.
- Triage: classify every uploaded log by size, start time, and shape before reading content.
- Timeline: build a chronological view across all logs with inter-log deltas.
- Classify the question: is the user asking about a flip-flop field, a failed DML, a slow transaction, a flow error, an async job, a merge, a permission issue, or something else? Each has a different investigation recipe.
- Load the right reference: the
references/ folder has dedicated guides for each major category. Load only what applies.
- Execute the recipe: run the specific greps and Python extractions for that category.
- Report with structure: headline, evidence, mechanism, limits, recommendations.
Step 1: triage every log
Before reading any content, run:
cd /mnt/user-data/uploads
ls -la *.log
for f in *.log; do
start=$(head -3 "$f" | tail -1 | awk '{print $1}')
size=$(wc -c < "$f")
entry=$(head -5 "$f" | grep -oE "EXECUTION_STARTED|BATCH_APEX|CRON_|CODE_UNIT_STARTED[^|]*\|[^|]*" | head -1)
echo "$start size=$size $f entry=$entry"
done | sort
Classify each log by shape:
| Shape |
Size |
Signal |
Meaning |
| Parent synchronous |
under 1MB |
Opens with a top-level CODE_UNIT_STARTED, shallow nesting |
UI action, API call, or controller entry that started something |
| Cascade (trigger/flow storm) |
2 to 10MB+ |
Many CODE_UNIT_STARTED.*trigger, FLOW_START_INTERVIEW_BEGIN |
Downstream firestorm caused by a DML |
| Batch execution |
variable |
BATCH_APEX_START, BATCH_ID= |
Batch Apex execute() scope |
| Queueable |
medium |
`CODE_UNIT_STARTED |
[EventService....queueable` |
| Future method |
medium |
`CODE_UNIT_STARTED |
[future]or namespace +System.future` |
| Scheduled |
medium |
CRON_TRIGGER_ in header |
Scheduled Apex fire |
| Platform event trigger |
medium |
Trigger on *__e Object |
Event subscriber firing |
| Change Data Capture |
medium |
Trigger on *__ChangeEvent |
CDC subscriber firing |
| LWC/Aura controller call |
small to medium |
`CODE_UNIT_STARTED |
[EventService.....auraor.apex] |
| Visualforce |
small to medium |
VF_PAGE_MESSAGE, VF_APEX_CALL |
VF controller lifecycle |
| REST/SOAP service |
medium |
EXECUTION_STARTED then Apex REST resource class |
External API hitting custom Apex endpoint |
| Test execution |
medium |
CODE_UNIT_STARTED.*test, TESTING_LIMITS |
@isTest run |
Step 2: build the timeline
python3 << 'EOF'
import re, os
logs = []
for f in sorted(os.listdir('.')):
if f.endswith('.log'):
with open(f) as fp:
fp.readline()
m = re.match(r'(\d{2}:\d{2}:\d{2}\.\d+)', fp.readline())
if m: logs.append((m.group(1), f, os.path.getsize(f)))
logs.sort()
prev = None
for t, f, s in logs:
delta = ""
if prev:
def sec(x):
h,m,s = x.split(':'); return int(h)*3600+int(m)*60+float(s)
delta = f"+{sec(t)-sec(prev):.1f}s"
tp = "small" if s < 1_000_000 else "large"
print(f"{t} {tp:5s} {s:>10} {f} {delta}")
prev = t
EOF
Patterns in deltas:
- Fixed interval every 10 to 60 seconds: scheduled job or retry loop
- Fixed interval every few minutes: scheduled flow or cron
- Tight parent/child pairs within 1 to 5 seconds: single logical operation
- Burst then quiet: bulk load or data migration
- Steadily shrinking intervals: runaway recursion
Step 3: classify the question
Based on what the user is asking, match to the primary investigation category below. The reference file for each category is named in the right column.
| User's symptom or question |
Category |
Load reference |
| "Why is this field changing?" "Flip-flop" |
Field write attribution |
flows.md, apex-and-async.md, managed-packages.md, recipes.md |
| "Why did my flow fail?" "Flow error" |
Flow diagnostics |
flows.md, error-codes.md |
| "My LWC is slow/erroring" "Aura action failed" |
UI framework Apex calls |
ui-frameworks.md |
| "My batch is stuck/failing" |
Async Apex |
apex-and-async.md, recipes.md |
| "Platform event not firing" "CDC trigger not running" |
Event-driven Apex |
apex-and-async.md, integration.md |
| "UNABLE_TO_LOCK_ROW" "Deadlock" |
Concurrency |
error-codes.md, recipes.md |
| "INSUFFICIENT_ACCESS" "merge won't work" "can't see record" |
Sharing and FLS |
error-codes.md, security-sharing.md, recipes.md |
| "Too many SOQL" "CPU timeout" "Heap exceeded" |
Governor limits |
governor-and-performance.md, recipes.md |
| "Workflow rule not firing" "Process Builder" "Approval" |
Legacy automation |
legacy-automation.md |
| "Validation rule blocking" |
Validation |
error-codes.md |
| "Callout failing" "Named credential" "External service" |
Integration |
integration.md, recipes.md |
"What's this xyz namespace?" |
Unknown managed package |
managed-packages.md |
| "My test is failing but works in prod" |
Test execution |
apex-and-async.md |
| "VF page throwing" |
Visualforce |
ui-frameworks.md |
| "Duplicate rule blocked" "Matching rule" |
Duplicate handling |
specialized-topics.md |
| "Omni-Channel routing issue" "Skill-based routing" |
Service Cloud routing |
specialized-topics.md |
| "Einstein bot error" "NBA strategy failed" |
AI features |
specialized-topics.md |
| "Continuation timeout" "Transaction Finalizer" |
Advanced async |
specialized-topics.md |
| "Big Object query" "Custom Metadata query" |
Specialized data stores |
specialized-topics.md |
| "Lead conversion issue" "Case merge failure" |
Lifecycle operations |
specialized-topics.md, recipes.md |
| "Community user can't see" "Guest User" |
Experience Cloud |
security-sharing.md, ui-frameworks.md |
| "Encrypted field masked" "Shield" |
Encryption |
security-sharing.md, specialized-topics.md |
| "User needs to see X but can't" |
Access model |
security-sharing.md, recipes.md |
| "Slack/Quip/Heroku Connect" |
External platform integration |
specialized-topics.md, integration.md |
If the question touches multiple categories (common), load multiple references.
Step 4: universal patterns worth knowing before opening any reference
Track field value transitions (flip-flop diagnostics)
import re
for f in sorted_logs:
with open(f) as fp: content = fp.read()
matches = re.findall(r'RECORD_ID_FRAGMENT[^}]*?FIELD_NAME[=:]"?([^,"}]+)"?', content)
prev = None
for i, m in enumerate(matches):
if m != prev:
print(f"{f} [{i:3d}] {m}")
prev = m
Only print transitions. The transition index reveals how deep in the cascade the flip happens. Consistent index across logs = same automation responsible.
Extract the full execution cascade
# Every code unit and flow interview that fired, in order
grep -E "CODE_UNIT_STARTED|FLOW_START_INTERVIEW_BEGIN|BATCH_APEX|VF_APEX_CALL" log.log | head -60
Extract all DML operations
grep -E "DML_BEGIN|DML_END" log.log | head -50
Extract all exceptions
grep -E "EXCEPTION_THROWN|FATAL_ERROR|FLOW_ELEMENT_FAULT|VALIDATION_FAIL" log.log
Identify the running user and context
Every log has a header with the user ID, organization, and trace flag levels. Check:
head -20 log.log | grep -E "USER_INFO|EXECUTION_STARTED|APEX_CODE"
Also check LastModifiedById in any FLOW_VALUE_ASSIGNMENT record dumps. If it points to an integration user (0050B..., 005...), you are looking at automation context. If it points to a human user (005...), it's a UI or API action by that person.
Step 5: identify who wrote a field (the four mechanisms)
A field can change through exactly four mechanisms. Each has a different log signature. Before accusing any specific automation, classify which mechanism is in play:
- Direct Apex assignment:
VARIABLE_ASSIGNMENT target inside a Trigger or Apex class CODE_UNIT_STARTED block. Grep: grep -B2 "FIELD_NAME =" log.log
- Flow assignment:
FLOW_ASSIGNMENT_DETAIL|<flow-id>|<variable>|<value> or the field in FLOW_VALUE_ASSIGNMENT as a changed value. Grep: grep "FLOW_ASSIGNMENT_DETAIL" log.log | grep FIELD_NAME
- Rollup recalculation (DLRS, native roll-up summary, Apex rollup): field appears in before/after record snapshots with a different value, but nothing targets it in any assignment event. Before-update triggers or master-detail rollups recalculated it.
- Formula or calculated field: never actually stored. Recalculated on every read. If grep finds it in SELECT queries but never as an assignment target, it is a formula. You cannot trace who "changed" it because nothing writes to it.
Before blaming a flow or trigger, determine which mechanism applies. Check the field metadata if you can: rollups have SummaryField__c markers, formulas have Formula__c markers in record dumps.
Step 6: report with structure
When reporting to the user, always use this structure:
- Headline: one sentence naming the root cause.
- Evidence: specific log events (with timestamps or line numbers) that support it.
- Timeline: if multi-log, the ordered timeline with deltas.
- Mechanism: how this causes the symptom, in terms of SF platform behavior.
- What the log cannot tell you: explicit limits on what the log shows.
- Recommendations: ordered from "stop the bleeding" to "long-term fix".
Do not dump raw log content. Summarize and quote only specific lines that matter.
Limits: be explicit about what the log cannot tell you
The log cannot tell you:
- Which specific record is blocking a merge when the error says
not accessible: []
- Why a user's profile/role hierarchy denies access (only that it does)
- What a formula field was "before" the transaction (formulas recalculate, they do not store)
- What happened in a different transaction that is not uploaded
- The org's OWD, sharing rules, role hierarchy, or permission set assignments
- Whether a field is a rollup, a formula, or a direct write (you must check metadata)
- Why a scheduled job fires at a particular time (check Setup > Scheduled Jobs)
- What ran inside a managed package below
ENTERING_MANAGED_PKG (by design)
- The content of encrypted fields (shown as
**** or omitted)
- What happened on the server between a callout request and response if the remote system is third-party
When hitting one of these, state so plainly. Give the user the concrete next step outside the log: impersonate user X, query child records as admin vs integration user, open the field setup page, check Setup > Monitoring > Apex Jobs, etc.
Reference files
The references/ folder has dedicated guides. Load the ones relevant to the category you identified in step 3:
event-types.md: complete catalog of APEX_CODE event types, header parsing, log level categories, grep cheat sheet
flows.md: all flow types (record-triggered, screen, scheduled, platform event, orchestrator), flow events, fault paths, Pause, subflows, bulkification, recursion
apex-and-async.md: triggers, classes, batch, queueable, future, scheduled, platform events, CDC, test execution, recursion control, mixed DML
ui-frameworks.md: LWC @AuraEnabled patterns, Lightning Data Service, Aura server actions, Visualforce controllers, Experience Cloud/Communities, OmniStudio
managed-packages.md: 50+ package signatures with namespace, field patterns, and known gotchas (TracRTC, DLRS, EDA, traa, CPQ, Vlocity, nCino, FinServ, Pardot, Marketo, DocuSign, and many more)
error-codes.md: DML status codes, flow fault errors, limit exceptions, sharing/access errors, concurrency errors, mixed DML
governor-and-performance.md: all governor limits, per-namespace tracking, CPU and heap analysis, SOQL selectivity, query plan reading, performance optimization patterns
legacy-automation.md: workflow rules, process builder (now flow), approval processes, assignment rules, auto-response, escalation, entitlement, time-based actions, order of execution
integration.md: callouts, named credentials, external services, platform events as integration, CDC, outbound messaging, streaming API, OAuth, Bulk API, MuleSoft/Boomi, Salesforce Connect
security-sharing.md: OWD, role hierarchy, sharing rules, manual sharing, Apex managed sharing (__Share), implicit sharing, territory management, restriction rules, profile vs permission set, FLS, CRUD, with/without sharing, USER_MODE/SYSTEM_MODE and the apiVersion 67.0 default-user-mode change, the removal of WITH SECURITY_ENFORCED at 67.0, Shield Platform Encryption, Guest User, Community/Experience Cloud access
specialized-topics.md: Platform Cache, Transaction Finalizers, Continuations, Big Objects, Custom Metadata, Custom Settings, Duplicate Rules, Matching Rules, Lead Conversion, Case Merge, Omni-Channel, Einstein Bots, Einstein Next Best Action, Einstein Activity Capture, Lightning Message Service, Salesforce Functions (deprecated), Heroku Connect, Data Cloud/CDP, Slack integration, Approval Processes, Account/Opportunity/Case Teams, Record Types, Person Accounts, S2S, mobile, and more
recipes.md: end-to-end investigation workflows for the most common problems: flip-flop field, merge failure, governor limit, UNABLE_TO_LOCK_ROW concurrency, performance bottleneck, recursion/infinite loop, missing field update, user access issue, async job stuck, integration silently failing, bulk upload failing, emergency "stop the bleeding" checklist
examples.md, gotchas.md, well-architected.md, llm-anti-patterns.md: repo-standard quality-gate files (worked examples, platform gotchas, pillar framing, anti-patterns to avoid).
Read these only when they apply. Do not preload all of them.
Related skills
apex/debug-and-logging — production logging strategy, structured sinks, async job monitoring (how to instrument).
apex/debug-logs-and-developer-console — trace flag setup, Developer Console, anonymous Apex, Apex Replay Debugger (how to capture).
apex/governor-limits and apex/apex-limits-monitoring — deeper governor-limit treatment once a hit is diagnosed.
apex/common-apex-runtime-errors — error taxonomy reference once a specific exception is identified.
Official Sources Used
1---2name: salesforce-debug-log-analysis3description: Use when the user has captured Salesforce debug logs and needs forensic analysis of runtime behavior — trigger cascades, flow interviews, LWC/Aura @AuraEnabled calls, batch/queueable/future/scheduled Apex, platform events, CDC, validation/workflow/approvals, callouts, DML failures, governor limit hits, managed-package traces, flip-flop fields, UNABLE_TO_LOCK_ROW, INSUFFICIENT_ACCESS, mixed DML. Triggers: '.log file', 'debug log', 'why is this field changing', 'flow cascade', 'CPU timeout', 'heap exceeded', 'UNABLE_TO_LOCK_ROW', 'INSUFFICIENT_ACCESS', 'replay debugger'. NOT for choosing log levels or designing a logging framework (use apex/debug-and-logging), and NOT for setting up trace flags or Developer Console (use apex/debug-logs-and-developer-console).4---56# Salesforce Debug Log Analysis78Salesforce debug logs look like text but behave like event traces from a distributed system. A single record update can produce tens of thousands of lines across dozens of triggers, flows, LWC controllers, rollup calculations, validation rules, workflow field updates, platform events, and managed packages. The real cause is often in a different transaction than the one the user uploaded, or inside a package whose source you cannot read. This skill captures the complete investigation pattern for every type of Salesforce runtime behavior.910## Recommended Workflow1112For any Salesforce log, follow this loop in order. Do not skip steps.13141. **Triage**: classify every uploaded log by size, start time, and shape before reading content.152. **Timeline**: build a chronological view across all logs with inter-log deltas.163. **Classify the question**: is the user asking about a flip-flop field, a failed DML, a slow transaction, a flow error, an async job, a merge, a permission issue, or something else? Each has a different investigation recipe.174. **Load the right reference**: the `references/` folder has dedicated guides for each major category. Load only what applies.185. **Execute the recipe**: run the specific greps and Python extractions for that category.196. **Report with structure**: headline, evidence, mechanism, limits, recommendations.2021## Step 1: triage every log2223Before reading any content, run:2425```bash26cd /mnt/user-data/uploads27ls -la *.log2829for f in *.log; do30 start=$(head -3 "$f" | tail -1 | awk '{print $1}')31 size=$(wc -c < "$f")32 entry=$(head -5 "$f" | grep -oE "EXECUTION_STARTED|BATCH_APEX|CRON_|CODE_UNIT_STARTED[^|]*\|[^|]*" | head -1)33 echo "$start size=$size $f entry=$entry"34done | sort35```3637Classify each log by shape:3839| Shape | Size | Signal | Meaning |40|---|---|---|---|41| Parent synchronous | under 1MB | Opens with a top-level `CODE_UNIT_STARTED`, shallow nesting | UI action, API call, or controller entry that started something |42| Cascade (trigger/flow storm) | 2 to 10MB+ | Many `CODE_UNIT_STARTED.*trigger`, `FLOW_START_INTERVIEW_BEGIN` | Downstream firestorm caused by a DML |43| Batch execution | variable | `BATCH_APEX_START`, `BATCH_ID=` | Batch Apex execute() scope |44| Queueable | medium | `CODE_UNIT_STARTED|[EventService....queueable` | Async job |45| Future method | medium | `CODE_UNIT_STARTED|[future]` or namespace + `System.future` | @future continuation |46| Scheduled | medium | `CRON_TRIGGER_` in header | Scheduled Apex fire |47| Platform event trigger | medium | Trigger on `*__e` Object | Event subscriber firing |48| Change Data Capture | medium | Trigger on `*__ChangeEvent` | CDC subscriber firing |49| LWC/Aura controller call | small to medium | `CODE_UNIT_STARTED|[EventService.....aura` or `.apex]|*Controller.*` | @AuraEnabled method invoked |50| Visualforce | small to medium | `VF_PAGE_MESSAGE`, `VF_APEX_CALL` | VF controller lifecycle |51| REST/SOAP service | medium | `EXECUTION_STARTED` then Apex REST resource class | External API hitting custom Apex endpoint |52| Test execution | medium | `CODE_UNIT_STARTED.*test`, `TESTING_LIMITS` | @isTest run |5354## Step 2: build the timeline5556```python57python3 << 'EOF'58import re, os59logs = []60for f in sorted(os.listdir('.')):61 if f.endswith('.log'):62 with open(f) as fp:63 fp.readline()64 m = re.match(r'(\d{2}:\d{2}:\d{2}\.\d+)', fp.readline())65 if m: logs.append((m.group(1), f, os.path.getsize(f)))66logs.sort()67prev = None68for t, f, s in logs:69 delta = ""70 if prev:71 def sec(x):72 h,m,s = x.split(':'); return int(h)*3600+int(m)*60+float(s)73 delta = f"+{sec(t)-sec(prev):.1f}s"74 tp = "small" if s < 1_000_000 else "large"75 print(f"{t} {tp:5s} {s:>10} {f} {delta}")76 prev = t77EOF78```7980Patterns in deltas:81- Fixed interval every 10 to 60 seconds: scheduled job or retry loop82- Fixed interval every few minutes: scheduled flow or cron83- Tight parent/child pairs within 1 to 5 seconds: single logical operation84- Burst then quiet: bulk load or data migration85- Steadily shrinking intervals: runaway recursion8687## Step 3: classify the question8889Based on what the user is asking, match to the primary investigation category below. The reference file for each category is named in the right column.9091| User's symptom or question | Category | Load reference |92|---|---|---|93| "Why is this field changing?" "Flip-flop" | Field write attribution | `flows.md`, `apex-and-async.md`, `managed-packages.md`, `recipes.md` |94| "Why did my flow fail?" "Flow error" | Flow diagnostics | `flows.md`, `error-codes.md` |95| "My LWC is slow/erroring" "Aura action failed" | UI framework Apex calls | `ui-frameworks.md` |96| "My batch is stuck/failing" | Async Apex | `apex-and-async.md`, `recipes.md` |97| "Platform event not firing" "CDC trigger not running" | Event-driven Apex | `apex-and-async.md`, `integration.md` |98| "UNABLE_TO_LOCK_ROW" "Deadlock" | Concurrency | `error-codes.md`, `recipes.md` |99| "INSUFFICIENT_ACCESS" "merge won't work" "can't see record" | Sharing and FLS | `error-codes.md`, `security-sharing.md`, `recipes.md` |100| "Too many SOQL" "CPU timeout" "Heap exceeded" | Governor limits | `governor-and-performance.md`, `recipes.md` |101| "Workflow rule not firing" "Process Builder" "Approval" | Legacy automation | `legacy-automation.md` |102| "Validation rule blocking" | Validation | `error-codes.md` |103| "Callout failing" "Named credential" "External service" | Integration | `integration.md`, `recipes.md` |104| "What's this `xyz` namespace?" | Unknown managed package | `managed-packages.md` |105| "My test is failing but works in prod" | Test execution | `apex-and-async.md` |106| "VF page throwing" | Visualforce | `ui-frameworks.md` |107| "Duplicate rule blocked" "Matching rule" | Duplicate handling | `specialized-topics.md` |108| "Omni-Channel routing issue" "Skill-based routing" | Service Cloud routing | `specialized-topics.md` |109| "Einstein bot error" "NBA strategy failed" | AI features | `specialized-topics.md` |110| "Continuation timeout" "Transaction Finalizer" | Advanced async | `specialized-topics.md` |111| "Big Object query" "Custom Metadata query" | Specialized data stores | `specialized-topics.md` |112| "Lead conversion issue" "Case merge failure" | Lifecycle operations | `specialized-topics.md`, `recipes.md` |113| "Community user can't see" "Guest User" | Experience Cloud | `security-sharing.md`, `ui-frameworks.md` |114| "Encrypted field masked" "Shield" | Encryption | `security-sharing.md`, `specialized-topics.md` |115| "User needs to see X but can't" | Access model | `security-sharing.md`, `recipes.md` |116| "Slack/Quip/Heroku Connect" | External platform integration | `specialized-topics.md`, `integration.md` |117118If the question touches multiple categories (common), load multiple references.119120## Step 4: universal patterns worth knowing before opening any reference121122### Track field value transitions (flip-flop diagnostics)123124```python125import re126for f in sorted_logs:127 with open(f) as fp: content = fp.read()128 matches = re.findall(r'RECORD_ID_FRAGMENT[^}]*?FIELD_NAME[=:]"?([^,"}]+)"?', content)129 prev = None130 for i, m in enumerate(matches):131 if m != prev:132 print(f"{f} [{i:3d}] {m}")133 prev = m134```135136Only print transitions. The transition index reveals how deep in the cascade the flip happens. Consistent index across logs = same automation responsible.137138### Extract the full execution cascade139140```bash141# Every code unit and flow interview that fired, in order142grep -E "CODE_UNIT_STARTED|FLOW_START_INTERVIEW_BEGIN|BATCH_APEX|VF_APEX_CALL" log.log | head -60143```144145### Extract all DML operations146147```bash148grep -E "DML_BEGIN|DML_END" log.log | head -50149```150151### Extract all exceptions152153```bash154grep -E "EXCEPTION_THROWN|FATAL_ERROR|FLOW_ELEMENT_FAULT|VALIDATION_FAIL" log.log155```156157### Identify the running user and context158159Every log has a header with the user ID, organization, and trace flag levels. Check:160161```bash162head -20 log.log | grep -E "USER_INFO|EXECUTION_STARTED|APEX_CODE"163```164165Also check `LastModifiedById` in any `FLOW_VALUE_ASSIGNMENT` record dumps. If it points to an integration user (`0050B...`, `005...`), you are looking at automation context. If it points to a human user (`005...`), it's a UI or API action by that person.166167## Step 5: identify who wrote a field (the four mechanisms)168169A field can change through exactly four mechanisms. Each has a different log signature. Before accusing any specific automation, classify which mechanism is in play:1701711. **Direct Apex assignment**: `VARIABLE_ASSIGNMENT` target inside a Trigger or Apex class `CODE_UNIT_STARTED` block. Grep: `grep -B2 "FIELD_NAME =" log.log`1722. **Flow assignment**: `FLOW_ASSIGNMENT_DETAIL|<flow-id>|<variable>|<value>` or the field in `FLOW_VALUE_ASSIGNMENT` as a changed value. Grep: `grep "FLOW_ASSIGNMENT_DETAIL" log.log | grep FIELD_NAME`1733. **Rollup recalculation** (DLRS, native roll-up summary, Apex rollup): field appears in before/after record snapshots with a different value, but nothing targets it in any assignment event. Before-update triggers or master-detail rollups recalculated it.1744. **Formula or calculated field**: never actually stored. Recalculated on every read. If grep finds it in SELECT queries but never as an assignment target, it is a formula. You cannot trace who "changed" it because nothing writes to it.175176Before blaming a flow or trigger, determine which mechanism applies. Check the field metadata if you can: rollups have `SummaryField__c` markers, formulas have `Formula__c` markers in record dumps.177178## Step 6: report with structure179180When reporting to the user, always use this structure:1811821. **Headline**: one sentence naming the root cause.1832. **Evidence**: specific log events (with timestamps or line numbers) that support it.1843. **Timeline**: if multi-log, the ordered timeline with deltas.1854. **Mechanism**: how this causes the symptom, in terms of SF platform behavior.1865. **What the log cannot tell you**: explicit limits on what the log shows.1876. **Recommendations**: ordered from "stop the bleeding" to "long-term fix".188189Do not dump raw log content. Summarize and quote only specific lines that matter.190191## Limits: be explicit about what the log cannot tell you192193The log cannot tell you:194- Which specific record is blocking a merge when the error says `not accessible: []`195- Why a user's profile/role hierarchy denies access (only that it does)196- What a formula field was "before" the transaction (formulas recalculate, they do not store)197- What happened in a different transaction that is not uploaded198- The org's OWD, sharing rules, role hierarchy, or permission set assignments199- Whether a field is a rollup, a formula, or a direct write (you must check metadata)200- Why a scheduled job fires at a particular time (check Setup > Scheduled Jobs)201- What ran inside a managed package below `ENTERING_MANAGED_PKG` (by design)202- The content of encrypted fields (shown as `****` or omitted)203- What happened on the server between a callout request and response if the remote system is third-party204205When hitting one of these, state so plainly. Give the user the concrete next step outside the log: impersonate user X, query child records as admin vs integration user, open the field setup page, check Setup > Monitoring > Apex Jobs, etc.206207## Reference files208209The `references/` folder has dedicated guides. Load the ones relevant to the category you identified in step 3:210211- `event-types.md`: complete catalog of APEX_CODE event types, header parsing, log level categories, grep cheat sheet212- `flows.md`: all flow types (record-triggered, screen, scheduled, platform event, orchestrator), flow events, fault paths, Pause, subflows, bulkification, recursion213- `apex-and-async.md`: triggers, classes, batch, queueable, future, scheduled, platform events, CDC, test execution, recursion control, mixed DML214- `ui-frameworks.md`: LWC @AuraEnabled patterns, Lightning Data Service, Aura server actions, Visualforce controllers, Experience Cloud/Communities, OmniStudio215- `managed-packages.md`: 50+ package signatures with namespace, field patterns, and known gotchas (TracRTC, DLRS, EDA, traa, CPQ, Vlocity, nCino, FinServ, Pardot, Marketo, DocuSign, and many more)216- `error-codes.md`: DML status codes, flow fault errors, limit exceptions, sharing/access errors, concurrency errors, mixed DML217- `governor-and-performance.md`: all governor limits, per-namespace tracking, CPU and heap analysis, SOQL selectivity, query plan reading, performance optimization patterns218- `legacy-automation.md`: workflow rules, process builder (now flow), approval processes, assignment rules, auto-response, escalation, entitlement, time-based actions, order of execution219- `integration.md`: callouts, named credentials, external services, platform events as integration, CDC, outbound messaging, streaming API, OAuth, Bulk API, MuleSoft/Boomi, Salesforce Connect220- `security-sharing.md`: OWD, role hierarchy, sharing rules, manual sharing, Apex managed sharing (__Share), implicit sharing, territory management, restriction rules, profile vs permission set, FLS, CRUD, with/without sharing, USER_MODE/SYSTEM_MODE and the `apiVersion` 67.0 default-user-mode change, the removal of WITH SECURITY_ENFORCED at 67.0, Shield Platform Encryption, Guest User, Community/Experience Cloud access221- `specialized-topics.md`: Platform Cache, Transaction Finalizers, Continuations, Big Objects, Custom Metadata, Custom Settings, Duplicate Rules, Matching Rules, Lead Conversion, Case Merge, Omni-Channel, Einstein Bots, Einstein Next Best Action, Einstein Activity Capture, Lightning Message Service, Salesforce Functions (deprecated), Heroku Connect, Data Cloud/CDP, Slack integration, Approval Processes, Account/Opportunity/Case Teams, Record Types, Person Accounts, S2S, mobile, and more222- `recipes.md`: end-to-end investigation workflows for the most common problems: flip-flop field, merge failure, governor limit, UNABLE_TO_LOCK_ROW concurrency, performance bottleneck, recursion/infinite loop, missing field update, user access issue, async job stuck, integration silently failing, bulk upload failing, emergency "stop the bleeding" checklist223- `examples.md`, `gotchas.md`, `well-architected.md`, `llm-anti-patterns.md`: repo-standard quality-gate files (worked examples, platform gotchas, pillar framing, anti-patterns to avoid).224225Read these only when they apply. Do not preload all of them.226227## Related skills228229- `apex/debug-and-logging` — production logging strategy, structured sinks, async job monitoring (how to instrument).230- `apex/debug-logs-and-developer-console` — trace flag setup, Developer Console, anonymous Apex, Apex Replay Debugger (how to capture).231- `apex/governor-limits` and `apex/apex-limits-monitoring` — deeper governor-limit treatment once a hit is diagnosed.232- `apex/common-apex-runtime-errors` — error taxonomy reference once a specific exception is identified.233234## Official Sources Used235236- Apex Developer Guide — [Debug Log](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm), [Debug Log Levels](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log_levels.htm), [Event Types](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_log_events_reference.htm)237- Apex Reference Guide — [System.Limits](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_limits.htm), [AsyncApexJob](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_asyncapexjob.htm)238- Salesforce Developer Guide — [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm), [Governor Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm)239- Flow runtime — [Flow Fault Paths](https://help.salesforce.com/s/articleView?id=sf.flow_build_fault_connector.htm), [Debug a Flow](https://help.salesforce.com/s/articleView?id=sf.flow_distribute_debug.htm)240- Salesforce Help — [Monitor Debug Logs](https://help.salesforce.com/s/articleView?id=sf.code_add_users_debug_log.htm), [Trace Flags](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_traceflag.htm), [Apex Replay Debugger](https://developer.salesforce.com/tools/vscode/en/apex/replay-debugger)241- Salesforce Architects — [Well-Architected framework](https://architect.salesforce.com/well-architected/overview)