---
schema_version: "1"
id: 9b725003bf405eac1f5f32a0bf89089ee37ac9b4c15cd2c651fb123dc6e80f4c
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/webconsole/guides/work-with-code/debug-your-code/add-trace-flags.md
canonical_url: https://developer.salesforce.com/docs/platform/webconsole/guide/add-trace-flags.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 968903444d0a2ecb50cfa0264dd3699b4cbac4836a36a760078bc5e5e6d5e906
products:
  - Web Console
  - 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"}')

