---
schema_version: "1"
id: 86d4963705823cce8ec7b3458e9643a8816e34391d8eaf2c49796cf0ddd52e0f
title: Set Up Debug Logging
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/code_add_users_debug_log.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.code_add_users_debug_log.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 94519839376881b6d2a1f0b7fb0c55aa5b8fcb04594dccd766bf715926297158
description: To activate debug logging for users, Apex classes, and Apex triggers, configure trace flags and debug levels in the Developer Console or in Setup. Each trace flag includes a debug level, start time, end time, and log type. The trace flag’s log type specifies the entity you’re tracing.
products:
  - Security
release: "264"
---
# Set Up Debug Logging

To activate debug logging for users, Apex classes, and Apex triggers, configure trace flags and debug levels in the Developer Console or in Setup. Each trace flag includes a debug level, start time, end time, and log type. The trace flag’s log type specifies the entity you’re tracing.

### Required Editions

<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="d47917e36">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d47917e36 ">To view, retain, and delete debug logs:</td>

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

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

To configure trace flags and debug levels from the Developer Console, click **Debug** | **Change Log Levels**. Then complete these actions.

- To create a trace flag, click **Add**.
- To edit an existing trace flag’s duration, double-click its start or end time.
- To change a trace flag’s debug level, click **Add/Change** in the Debug Level Action column. You can then edit your existing debug levels, create or delete a debug level, and assign a debug level to your trace flag. Deleting a debug level deletes all trace flags that use it.

## Create Trace Flags in Setup

1. From [Setup](https://help.salesforce.com/s/articleView?id=xcloud.basics_nav_setup.htm&type=5&language=en_US), use the Quick Find box to find and select **Debug Logs**.
2. Click **New**.
3. Select the entity to trace, the time period during which you want to collect logs, and a debug level.
    
    A debug level is a set of log levels for debug log categories: Database, Workflow, Validation, and so on. You can reuse debug levels across your trace flags.
    
    ![New Trace Flag page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-security-264-0-0-production-enus/8cecd769-ab2d-4e07-addf-c4f2927925e1/security/images/code_add_users_debug_log_new_trace_flag.png)

## View, Edit, or Delete Trace Flags in Setup

1. Navigate to the appropriate Setup page.
    - For user-based trace flags, use the Quick Find box to find and select **Debug Logs**.
    - For class-based trace flags, use the Quick Find box to find and select **Apex Classes**. Click the name of a class, then click **Trace Flags**.
    - For trigger-based trace flags, use the Quick Find box to find and select **Apex Triggers**. Click the name of a trigger, then click **Trace Flags**.
2. From the Setup page, click an option in the Action column.
    - To delete a trace flag, click **Delete**.
    - To modify a trace flag, click **Edit**.
    - To modify a trace flag’s debug level, click **Filters**.
    - To create a debug level, click **Edit**, and then click **New Debug Level**.

## Configure Debug Levels in Setup

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-security-264-0-0-production-enus/8cecd769-ab2d-4e07-addf-c4f2927925e1/images/icon_important.png)

Important The Debug Levels page is only available in Salesforce Classic. As an alternative, you can modify debug levels from the Developer Console or query the [DebugLevel](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_debuglevel.htm) object using Tooling API.

1. To manage your debug levels From [Setup](https://help.salesforce.com/s/articleView?id=xcloud.basics_nav_setup.htm&type=5&language=en_US), use the Quick Find box to find and select **Debug Levels**.
2. To edit or delete a debug level, click an option in the Action column. To create a debug level, click **New**.
    
    ![Debug Levels list view](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-security-264-0-0-production-enus/8cecd769-ab2d-4e07-addf-c4f2927925e1/security/images/code_add_users_debug_log_debug_levels.png)

#### See Also

- [Monitor Debug Logs](https://help.salesforce.com/s/articleView?id=xcloud.code_monitoring_debug_logs.htm&release=264.0.0&type=5 "Set trace flags to trigger logging for users, Apex classes, and Apex triggers in the Developer Console or in Setup. Monitor the resulting logs to diagnose problems in your org.")
- [Debug Logs](https://help.salesforce.com/s/articleView?id=platform.code_debug_log.htm&type=5&language=en_US)
- [Set Up Apex Class and Trigger Trace Flags](https://help.salesforce.com/s/articleView?id=platform.code_debug_log_classes_setup.htm&type=5&language=en_US)