Section 4 · Auditing and Monitoring · 10% of exam
4.1 Debug logs and Setup Audit Trail
Exam objective
Given a scenario, determine appropriate tools for monitoring and troubleshooting system activity, including debug logs and Setup Audit Trail.
Monitoring starts with a precise symptom and time window. A debug log records execution detail for a selected user or automation context and can reveal flow, Apex, validation, and other execution events. It is useful when a transaction fails, performs an unexpected update, or runs a different path than anticipated. Logs are not a permanent business audit store; they have size and retention constraints, and excessive logging can create noise or consume storage. Set trace flags narrowly, reproduce the behavior, capture the log, and remove or adjust tracing afterward.
Read a debug log in execution order. Identify the transaction start, relevant automation entries, errors, limits, and the point at which the record state changed. A log may show that a flow or trigger ran, but interpretation requires understanding the transaction and record context. Correlate the timestamp with the user's action, record ID, and any related automation. A missing log can mean the wrong user was traced, the action used a different transaction, the trace flag expired, or the event occurred outside the selected time range.
Setup Audit Trail answers a different question: what administrative configuration changes were made, by whom, and when? It helps investigate unexpected permission changes, modified automation, or changes to org settings. Audit entries are not a full event log for all end-user activity or every data edit. If a scenario asks who changed a setup configuration, inspect the audit trail. If it asks why a transaction evaluated a rule or flow path in a particular way, inspect execution diagnostics such as debug logs and flow-specific tools.
Monitoring sensitive data requires deliberate controls in production and sandbox environments. Identify which fields contain confidential or regulated data, who can access them, and whether logs, exports, analytics, and sandbox copies can expose them. Use least privilege, field security, data masking where licensed and supported, and approved retention policies. A sandbox is not inherently safe because it is separate from production; copied data may contain live personal information. Coordinate with security, privacy, and legal teams where policy requires it.
Troubleshooting security settings includes checking current permissions and pending changes that can alter access. A permission set assignment, profile update, sharing recalculation, role or territory change, group membership change, or deployment can change effective access. Capture the current configuration and timing before changing anything. Compare affected and unaffected users, then inspect the exact grants and access routes. A pending setup operation can create a temporary state; check completion and system status rather than repeatedly applying a configuration. Operationally, define a monitoring workflow: record the incident time and actor, preserve relevant IDs, classify whether the issue is configuration, transaction, access, or data, select the matching tool, and keep only necessary evidence. Avoid sharing logs broadly because they can contain record values, user information, or implementation details. Redact sensitive values before sending logs outside approved channels. Record the root cause and corrective action so a one-time diagnostic does not become an undocumented production change.
Exam focus: debug logs reveal transaction execution; Setup Audit Trail reveals setup changes. Neither tool replaces a comprehensive security or data audit system. For a data exposure concern, evaluate production and sandbox copies and the destinations of logs and exports. For unexpected access, review current and pending access changes and the additive sources of permission. Choose the diagnostic tool based on what question the scenario is asking.
Debug logs can include sensitive context and have finite retention. Trace only the users and periods needed, protect downloaded log files, and remove them according to policy.
Practical scenario
A user reports that a record-triggered flow changed a priority field after save. Capture the user, record, and timestamp, set a focused trace flag for the transaction owner, reproduce once, and locate the flow entry and field update in the log. If the priority changed after an administrator deployed a new flow version, use Setup Audit Trail to confirm the setup change and timing. These tools answer related but different questions.
Extra concept
Field History Tracking and Setup Audit Trail should not be conflated. Field history can track selected data-field changes on supported objects, while Setup Audit Trail tracks administrative configuration changes. Decide which evidence is required before an incident occurs; each feature has limits on scope and retention.
Key takeaways
- Use debug logs to inspect transaction execution and Setup Audit Trail for admin changes.
- Trace only the user and period needed, then protect and dispose of log files.
- Use field history or other audit controls for data changes where configured.
- Official references: https://help.salesforce.com/s/articleView?id=005298969&language=en_US&type=1 https://help.salesforce.com/s/articleView?id=sf.code_debug_log.htm&type=5 https://help.salesforce.com/s/articleView?id=sf.admin_monitorsetup.htm&type=5 https://help.salesforce.com/s/articleView?id=sf.field_history_tracking.htm&type=5
