# Debugging with logs and monitoring async jobs and flows

*Platform Developer Study Guide · Testing, Debugging, and Deployment · Last updated October 15, 2026 · https://www.certifyforce.com/study-guide/platform-developer/testing-debugging-and-deployment/debugging-and-monitoring*

How trace flags, debug levels and debug logs capture a transaction, how to read a log for limits and performance, when to use checkpoints and the Apex Replay Debugger, and how to monitor batch, Queueable and future jobs (Apex Jobs, Flex Queue, AsyncApexJob) and failing flows.

- Certification: Salesforce Platform Developer
- Exam section: Testing, Debugging, and Deployment
- Study guide: https://www.certifyforce.com/study-guide/platform-developer

**Official exam objective:**

> Describe how to approach debugging system issues and monitoring flows, performance, asynchronous, and batch jobs.

## What the exam expects

- Capture the right debug log: set a trace flag on the user, class or trigger with a debug level that raises the categories you need and lowers the rest.
- Read a log for execution order and cumulative limit usage, and fix CPU and query problems it reveals.
- Choose between Developer Console checkpoints and the Apex Replay Debugger to inspect variable state.
- Monitor batch, Queueable, scheduled and future jobs with Apex Jobs, the Apex Flex Queue and AsyncApexJob, and pick the async type that makes a job monitorable and scalable.
- Surface and debug flow failures with error emails, fault paths, the Monitor tab and the Flow Builder debugger.

Key terms: **trace flag** (switches on logging for a user, class or trigger for a time window); **debug level** (a set of log levels per category, such as Apex Code FINEST); **checkpoint** (a heap snapshot taken the first time a chosen line runs); **AsyncApexJob** (the record behind every queued job); **flex queue** (where batch jobs wait in Holding status).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| When logs are generated | Active user trace flags, Apex test runs, requests with debugging headers | [Debug Logs](https://help.salesforce.com/s/articleView?id=sf.code_debug_log.htm&type=5) |
| CLASS_TRACING trace flag | Overrides levels for a class or trigger; can't generate a log alone | [Debug Log Levels](https://help.salesforce.com/s/articleView?id=sf.code_setting_debug_log_levels.htm&type=5) |
| Log size and retention | 20 MB per log; system logs 24 hours, monitoring logs seven days | [Debug Log](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm) |
| CPU time limit | 10,000 ms synchronous, 60,000 ms asynchronous | [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) |
| Developer Console checkpoints | Up to five; captured once per line | [Set Checkpoints in Apex Code](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_checkpoints_setting.htm&type=5) |
| Replay Debugger checkpoints | Up to five; expire after 30 minutes; one log at a time | [Apex Replay Debugger](https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/replay-debugger.html) |
| Apex Jobs page window | Jobs submitted in the past seven days; older via AsyncApexJob | [Monitor the Apex Job Queue](https://help.salesforce.com/s/articleView?id=sf.code_apex_job.htm&type=5) |
| Apex Flex Queue | Up to 100 Holding batch jobs; five queued or active at once | [Monitoring the Apex Flex Queue](https://help.salesforce.com/s/articleView?id=sf.code_apex_flex_queue.htm&type=5) |
| `System.enqueueJob` limit | 50 per synchronous transaction, 1 per asynchronous one | [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) |
| Flow error email recipient | Admin who last modified the flow or Apex exception email recipients | [Troubleshooting Flow Run Time Errors](https://help.salesforce.com/s/articleView?id=platform.flow_troubleshoot_email.htm&type=5) |

## Check yourself

- Why doesn't running the failing DML in Execute Anonymous reproduce another user's error?
- When is a CLASS_TRACING trace flag enough to produce a log?
- What status does a batch job show while it waits in the Apex Flex Queue?
- Why use Queueable rather than a future method for work you must monitor and chain?

## Sources

- [Debug Log](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log.htm)
- [Debug Logs](https://help.salesforce.com/s/articleView?id=sf.code_debug_log.htm&type=5)
- [Set Up Debug Logging](https://help.salesforce.com/s/articleView?id=sf.code_add_users_debug_log.htm&type=5)
- [Debug Log Levels](https://help.salesforce.com/s/articleView?id=sf.code_setting_debug_log_levels.htm&type=5)
- [Set Checkpoints in Apex Code](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_checkpoints_setting.htm&type=5)
- [Apex Replay Debugger](https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/replay-debugger.html)
- [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm)
- [Developer Console Query Editor](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_tab_query_editor.htm&type=5)
- [Asynchronous Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_async_overview.htm)
- [Using Batch Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm)
- [Queueable Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm)
- [Future Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm)
- [Monitor the Apex Job Queue](https://help.salesforce.com/s/articleView?id=sf.code_apex_job.htm&type=5)
- [Monitoring the Apex Flex Queue](https://help.salesforce.com/s/articleView?id=sf.code_apex_flex_queue.htm&type=5)
- [Troubleshooting Flow Run Time Errors](https://help.salesforce.com/s/articleView?id=platform.flow_troubleshoot_email.htm&type=5)
- [Monitoring and Managing Paused and Failed Flow Interviews](https://help.salesforce.com/s/articleView?id=platform.automate_ala_monitor.htm&language=en_US&type=5)
- [Test or Troubleshoot Flows with the Flow Builder Debugger](https://help.salesforce.com/s/articleView?id=sf.flow_test_debug.htm&type=5)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 12 linked practice questions, and unlimited timed mock exams are included with the Platform Developer pack (USD $19): https://www.certifyforce.com/practice-exams
