---
schema_version: "1"
id: 6347375cab7ec6611ab75a9ac7b91593aa1cd8bdb364ad421e5a47d6bb910ee5
title: "# Add Trace Flags and Log Levels"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/codebuilder/guides/files/develop/apex/debug/code-builder-add-trace-flags.md
canonical_url: https://developer.salesforce.com/docs/platform/code-builder/guide/code-builder-add-trace-flags.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d73c5d2c85059f3fab8d7cbc29020349eeb04b3dfc33a3336ac75d061059f1a1
products:
  - Agentforce Vibes IDE
  - salesforcedx
---
# # Add Trace Flags and Log Levels

To generate debug logs in Web Console, you must add user-specific trace flags and log levels in the `traceLogs.json` file.

1. Hover over the **No Tracing** label on the task bar and select **Create trace flags for the current user** to add a trace flag for your user.
   ![Tracing options on the task bar](https://developer.salesforce.com/docs/platform/media/webconsole/mouse_hover_trace_menu.png)
2. The `traceLogs.json` file opens with an added trace flag block for the current user. To change the log level for the current user, click the **Change** text before the `debugLevelName` property.
   ![Adding trace flags for the current user](https://developer.salesforce.com/docs/platform/media/webconsole/user_log_level.png)
3. To add trace flags for another user, click the **Add trace for another user** text before the `USER_DEBUG` property and specify a username to add.
4. Add log levels.

   **note:** For more information about log levels, refer to [Debug Log Levels](https://help.salesforce.com/s/articleView?id=platform.code_setting_debug_log_levels.htm&type=5)

   1. Click the **Create Debug level** text.
   2. Type a label and press Enter.
   3. To accept the default log levels, select **Yes**. To customize log levels, select **No** and select an option for different log types.
      ![Log levels are added in the traceLogs.json file](https://developer.salesforce.com/docs/platform/media/webconsole/debug_levels2.png)

5. To remove a block, click the **Remove** text before the block.
   Notice that the **No Tracing** label on the taskbar changes to **Tracing until END-TIME**.

   ![Tracing status showed on the taskbar](https://developer.salesforce.com/docs/platform/media/webconsole/tracing_started.png '{"class": "image-sm"}')

After the tracing starts, whenever you perform a task on the connected org, a log is generated with trace details. Here's an example.
![Logs with trace details](https://developer.salesforce.com/docs/platform/media/webconsole/logs_pulled.png)

Logs are pulled by default after every 30 seconds. You can change the log-pull interval in Settings.
![Log-pull interval in settings](https://developer.salesforce.com/docs/platform/media/webconsole/log_pull_time2.png '{"class": "image-lg"}')

