---
schema_version: "1"
id: 37f5242dab4037e5070e058ba21a3d0ba16f3b8c0d1c2b592e1014baf880f962
title: Debug Log Details
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_debug_log_details.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_debug_log_details.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 045879f8659b8d707a0c604af62518bd16bbdc92d0a3319911110b764cfeb2b0
description: A debug log includes a header, execution units, code units, log lines, and other log data.
products:
  - Salesforce Platform
release: "264"
---
# Debug Log Details

A debug log includes a header, execution units, code units, log lines, and other log data.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic (<a href="https://help.salesforce.com/s/articleView?id=xcloud.overview_edition_lex_only.htm&amp;type=5&amp;language=en_US" target="_blank">not available in all orgs</a>) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <span id="code_debug_log_details__Apex_Code_editions_text"><a name="code_debug_log_details__Apex_Code_editions_text"></a><strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, <strong>Developer</strong>, and <strong>Database.com</strong> Editions</span></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d25002e83">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d25002e83 ">To view, retain, and delete debug logs:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d25002e83 ">View All Data</td>

          </tr>
        </tbody>
      </table>

After you generate a debug log, the type and amount of information listed depends on the [filter values](https://help.salesforce.com/s/articleView?id=platform.code_setting_debug_log_levels.htm&release=264.0.0&type=5 "To specify the level of information that gets included in debug logs, set up trace flags and debug levels. The debug levels assigned to your trace flags control the type and amount of information that is logged for different events. After logging has occurred, inspect debug events in your debug logs.") you set for the user. However, the format for a debug log is always the same.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note Session IDs are replaced with "SESSION\_ID\_REMOVED" in Apex debug logs

The header contains execution units, code units, log lines, and additional log information.

## Execution Units

An execution unit is equivalent to a transaction. It contains everything that occurred within the transaction. `EXECUTION_STARTED` and `EXECUTION_FINISHED` delimit an execution unit.

## Code Units

A code unit is a discrete unit of work within a transaction. For example, a trigger is one unit of code, as is a `webservice` method or a validation rule.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note A class is not a discrete unit of code.

`CODE_UNIT_STARTED` and `CODE_UNIT_FINISHED` delimit units of code. Units of work can embed other units of work. For example:

```
EXECUTION_STARTED
CODE_UNIT_STARTED|[EXTERNAL]execute_anonymous_apex
CODE_UNIT_STARTED|[EXTERNAL]MyTrigger on Account trigger event BeforeInsert for [new]|__sfdc_trigger/MyTrigger
CODE_UNIT_FINISHED <-- The trigger ends
CODE_UNIT_FINISHED <-- The executeAnonymous ends
EXECUTION_FINISHED
```

Units of code include, but are not limited to, the following:

- Triggers
- Workflow invocations and time-based workflow
- Validation rules
- Approval processes
- Apex lead convert
- `@future` method invocations
- Web service invocations
- `executeAnonymous` calls
- Visualforce property accesses on Apex controllers
- Visualforce actions on Apex controllers
- Execution of the batch Apex `start` and `finish` methods, and each execution of the `execute` method
- Execution of the Apex `System.Schedule execute` method
- Incoming email handling

## Log Lines

Log lines are included inside units of code and indicate which code or rules are being executed. Log lines can also be messages written to the debug log. For example:

![Debug Log Line Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/debug_log_line_user_debug.png)

Log lines are made up of a set of fields, delimited by a pipe (`|`). The format is:

- timestamp: Consists of the time when the event occurred and a value between parentheses. The time is in the user’s time zone and in the format HH:mm:ss.SSS. The value in parentheses represents the time elapsed in nanoseconds since the start of the request. The elapsed time value is excluded from logs reviewed in the Developer Console when you use the Execution Log view. However, you can see the elapsed time when you use the Raw Log view. To open the Raw Log view, from the Developer Console’s Logs tab, right-click the name of a log and select **Open Raw Log**.
- event identifier: Specifies the event that triggered the debug log entry (such as `SAVEPOINT_RESET` or `VALIDATION_RULE`).
    
    Also includes additional information logged with that event, such as the method name or the line and character number where the code was executed. If a line number can’t be located, `[EXTERNAL]` is logged instead. For example, `[EXTERNAL]` is logged for built-in Apex classes or code that’s in a managed package.
    
    For some events (`CODE_UNIT_STARTED`, `CODE_UNIT_FINISHED`, `VF_APEX_CALL_START`, `VF_APEX_CALL_END`, `CONSTRUCTOR_ENTRY`, and `CONSTRUCTOR_EXIT`), the end of the event identifier includes a pipe (`|`) followed by a typeRef for an Apex class or trigger.
    
    For a trigger, the typeRef begins with the SFDC trigger prefix `__sfdc_trigger/`. For example, `__sfdc_trigger/YourTriggerName` or `__sfdc_trigger/YourNamespace/YourTriggerName`.
    
    For a class, the typeRef uses the format `YourClass`, `YourClass$YourInnerClass,` or `YourNamespace/YourClass$YourInnerClass`.

## More Log Data

In addition, the log contains the following information.

- Cumulative resource usage is logged at the end of many code units. Among these code units are triggers, `executeAnonymous`, batch Apex message processing, `@future` methods, Apex test methods, Apex web service methods, and Apex lead convert.
- Cumulative profiling information is logged once at the end of the transaction and contains information about DML invocations, expensive queries, and so on. “Expensive” queries use resources heavily.

- The version of the API used during the transaction.
- The [log category and level](https://help.salesforce.com/s/articleView?id=platform.code_setting_debug_log_levels.htm&release=264.0.0&type=5 "To specify the level of information that gets included in debug logs, set up trace flags and debug levels. The debug levels assigned to your trace flags control the type and amount of information that is logged for different events. After logging has occurred, inspect debug events in your debug logs.") used to generate the log. For example:

```
66.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;
WORKFLOW,INFO
```

In this example, the API version is 66.0, and the following debug log categories and levels have been set.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col style="width:50%"> <col style="width:50%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Apex Code</td><td class="slds-cell-wrap" style="vertical-align:top;">DEBUG</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Apex Profiling</td><td class="slds-cell-wrap" style="vertical-align:top;">INFO</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Callout</td><td class="slds-cell-wrap" style="vertical-align:top;">INFO</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Database</td><td class="slds-cell-wrap" style="vertical-align:top;">INFO</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">System</td><td class="slds-cell-wrap" style="vertical-align:top;">DEBUG</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Validation</td><td class="slds-cell-wrap" style="vertical-align:top;">INFO</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Visualforce</td><td class="slds-cell-wrap" style="vertical-align:top;">INFO</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Workflow</td><td class="slds-cell-wrap" style="vertical-align:top;">INFO</td></tr></tbody></table>

![Debug Log Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_example.png)

Debug Log Example

```
37.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;
    VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
Execute Anonymous: System.debug('Hello World!');
16:06:58.18 (18043585)|USER_INFO|[EXTERNAL]|005D0000001bYPN|devuser@example.org|
    Pacific Standard Time|GMT-08:00
16:06:58.18 (18348659)|EXECUTION_STARTED
16:06:58.18 (18383790)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
16:06:58.18 (23822880)|HEAP_ALLOCATE|[72]|Bytes:3
16:06:58.18 (24271272)|HEAP_ALLOCATE|[77]|Bytes:152
16:06:58.18 (24691098)|HEAP_ALLOCATE|[342]|Bytes:408
16:06:58.18 (25306695)|HEAP_ALLOCATE|[355]|Bytes:408
16:06:58.18 (25787912)|HEAP_ALLOCATE|[467]|Bytes:48
16:06:58.18 (26415871)|HEAP_ALLOCATE|[139]|Bytes:6
16:06:58.18 (26979574)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:1
16:06:58.18 (27384663)|STATEMENT_EXECUTE|[1]
16:06:58.18 (27414067)|STATEMENT_EXECUTE|[1]
16:06:58.18 (27458836)|HEAP_ALLOCATE|[1]|Bytes:12
16:06:58.18 (27612700)|HEAP_ALLOCATE|[50]|Bytes:5
16:06:58.18 (27768171)|HEAP_ALLOCATE|[56]|Bytes:5
16:06:58.18 (27877126)|HEAP_ALLOCATE|[64]|Bytes:7
16:06:58.18 (49244886)|USER_DEBUG|[1]|DEBUG|Hello World!
16:06:58.49 (49590539)|CUMULATIVE_LIMIT_USAGE
16:06:58.49 (49590539)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

16:06:58.49 (49590539)|CUMULATIVE_LIMIT_USAGE_END

16:06:58.18 (52417923)|CODE_UNIT_FINISHED|execute_anonymous_apex
16:06:58.18 (54114689)|EXECUTION_FINISHED
```

#### See Also

- [Debug Log Levels](https://help.salesforce.com/s/articleView?id=platform.code_setting_debug_log_levels.htm&release=264.0.0&type=5 "To specify the level of information that gets included in debug logs, set up trace flags and debug levels. The debug levels assigned to your trace flags control the type and amount of information that is logged for different events. After logging has occurred, inspect debug events in your debug logs.")
- [Searching a Debug Log](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_search_debug_log.htm&release=264.0.0&type=5 "To search for text in a debug log, use the Command Line Window in the Developer Console.")