---
title: Debugging
related:
  - https://docs.kentico.com/13/configuring-xperience/configuring-caching/debugging-the-application-cache.md
  - https://docs.kentico.com/13/macro-expressions/troubleshooting-macros/debugging-macros.md
  - https://docs.kentico.com/13/securing-websites/designing-secure-websites/securing-and-protecting-the-system/event-log-and-security-debug.md
  - https://docs.kentico.com/13/configuring-xperience/setting-up-web-farms/debugging-web-farms.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Debugging allows you to monitor internal activity within the system. You can use the debugging tools to:

- Find and fix problems with performance or specific features
- Get detailed information when reporting issues to Kentico support

The following types of debugging are available:

**Global system debugs**

- [Hash tables](#system-object-hash-tables) – provides information about the hash tables used by system objects
- [Worker threads](#worker-threads) – allows you to track and manage background tasks
- [Cache items](https://docs.kentico.com/13/configuring-xperience/configuring-caching/debugging-the-application-cache.md) – shows which data is cached in the application's memory
- [Email debugging](https://docs.kentico.com/13/configuring-xperience/configuring-smtp-servers.md#debugging-emails) – allows you to monitor and test the sending of emails from Xperience

**Debugs for individual web requests**

- [SQL queries](#sql-queries) – shows which SQL queries the system executes when processing requests
- [IO operations](#io-operations) – allows you to monitor file operations that occur in the system (both input and output)
- [Event handlers](#event-handlers) – displays the system events that were triggered while processing requests
- [Macros](https://docs.kentico.com/13/macro-expressions/troubleshooting-macros/debugging-macros.md) – allows you to analyze how the system resolves macro expressions
- [Cache access](https://docs.kentico.com/13/configuring-xperience/configuring-caching/debugging-the-application-cache.md) – shows the cache operations that the system performs during requests
- [Security](https://docs.kentico.com/13/securing-websites/designing-secure-websites/securing-and-protecting-the-system/event-log-and-security-debug.md) – shows the details and results of security operations (permission checks)
- [Web farm synchronization](https://docs.kentico.com/13/configuring-xperience/setting-up-web-farms/debugging-web-farms.md) – monitors the synchronization activity of web farm servers

## Enabling debugging

Most debugs are disabled by default, because debugging requires the system to perform extra operations and reduces website performance.

> **Note:** Always disable debugs before deploying websites to the production environment.

To configure debugging, adjust the settings in **Settings -> System -> Debug**.

The settings in the **General** category affect debugging globally:

| Setting             | Description                                                                                                                                                                                                                                                                                                          |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Disable debugging   | Globally disables all debugging tools, regardless of individual debug settings.                                                                                                                                                                                                                                      |
| Debug Import/Export | If disabled, the system does not log debug information for the pages of the [Import/Export](https://docs.kentico.com/13/deploying-websites/exporting-and-importing-sites.md) interface. For performance reasons, it is recommended to leave this option disabled unless you need to debug the Import/Export process. |
| Debug resources     | If disabled, the debug ignores all resource requests (_GetResource_ and _GetCSS_).                                                                                                                                                                                                                                   |
| Debug scheduler     | If disabled, the debug ignores all operations executed by the [scheduler](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md).                                                                                                                                                                    |

Configure individual debug types through the corresponding setting categories. The **All** category provides equivalent settings that enable all debugs:

| Setting                                  | Description                                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Debug everything everywhere              | Enables:<br>All debug types<br>Debugging of user interface pages for all debugs                                                                                                                                                                                                                                                                                         |
| Enable all debugs                        | Enables all debugs and the corresponding tabs in the interface of the **Debug** application.                                                                                                                                                                                                                                                                            |
| Include UI pages in all debugs           | If checked (true), all _enabled_ debugs include actions performed on the pages of the administration interface.                                                                                                                                                                                                                                                         |
| Default log length                       | Sets the default maximum length of the debug log in the **Debug** application. The default log length is used by debug types that do not have their own log length set.                                                                                                                                                                                                 |
| Display stack information in every debug | If enabled, the system tracks the code stack for all debug types and displays the information in the **Context** column of the debug interface in the **Debug** application.                                                                                                                                                                                            |
| Log everything to file                   | Enables logging of all possible operations into _.log_ files stored in the **\~/App\_Data/** folder (including the [Event log](https://docs.kentico.com/13/developing-websites/troubleshooting-websites/working-with-the-system-event-log.md) and [Email sending log](https://docs.kentico.com/13/configuring-xperience/configuring-smtp-servers.md#debugging-emails)). |

## Global system debugs

Global debugs provide general information about the status of the administration application. To access the debug interface, open the **Debug** application.

### System object hash tables

On the **System objects** tab of the debugging interface, you can view the number of objects stored in the system's hash tables. The debug shows two types of information:

- The number of records in individual hash tables
- The current number of hashed objects for individual object types

Click **Clear hash tables** to delete the content of all hash tables.

### Worker threads

The system uses worker threads to perform tasks in the background, so that the main application can remain responsive to users. Examples of separate threads in Xperience are [Smart search indexing](https://docs.kentico.com/13/configuring-xperience/setting-up-search-on-your-website.md) and sending of [marketing emails](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/email-marketing/sending-marketing-emails.md) or [mass emails](https://docs.kentico.com/13/managing-users/sending-emails.md).

You can manage threads on the **Worker threads** tab of the debug interface. Debugging of worker threads can be useful if your application is consuming significantly more resources than expected. Background threads may be the cause.

The debug shows two types of threads:

- **Running threads** – all worker threads currently running in the system. You can **Cancel** () individual running threads, or **View** () their progress log.
- **Finished threads** – the latest threads that have finished their activity.

## Debugs for individual web requests

The system provides debugs for analyzing web requests that occurred during recent activity in the administration interface or on the live site (for certain types of debugs). The recommended way to use web request debugs is to perform actions in one browser tab (or a different browser), and then check the results in the appropriate debug log.

Like with global debugs, you can access the web request debugging interface through the **Debug** application.

> **Tip:** To view the data of all enabled debugs for a specific request, click the request URL in any debug log.
>
> ![Click a request URL in any debug log to view all debugging information for the given request](https://docs.kentico.com/docsassets/13/debugging/Debug_request_details.png "Click a request URL in any debug log to view all debugging information for the given request")

### SQL queries

To check which database queries the application executes, select **SQL queries** in the debugging interface and open either the **Live site** or **Administration** tab.

Each tab displays SQL queries executed by the corresponding application, along with queries called within the context of every request. You can find the following information for each query:

- The name and SQL code of the query.
- The **Context** in which the query was called.
  - Click on the method to see the full stack trace.
  - If you enable the **Show complete context** option at the top of the interface, the stack trace is displayed for all queries.
- The **Duration** of the query execution.
- The total size of the data retrieved by the query.

Click **Clear debug log** to remove all data in the SQL debug.

> **Tip:** The system does not execute SQL queries if the required data is already cached in the application's memory. If you wish to force pages to execute queries while you are debugging, click **Clear cache** to flush the application's cache. Note that you can only clear the cache of the administration application (listed on the _Administration_ tab).

![Debugging SQL queries](https://docs.kentico.com/docsassets/13/debugging/SQL_debug.png "Debugging SQL queries")

### IO operations

The **File system (IO)** tab of the debugging interface allows you to monitor file operations that occur in the system (both input and output). The IO debug displays a list of recent requests, and all file operations carried out while processing individual requests. For each operation, you can see:

- The type of the operation.
- The size of the transferred data (if any).
- How many times the system accessed the file.
- The path of the affected file.
- The **Context** in which the file operation occurred.

  - Click on the method to see the full stack trace.
  - If you enable **Show complete context** at the top of the interface, the stack trace is displayed for all operations.

The **Provider** selector above the debug log allows you to filter the operations for individual file system providers (such as the _Local file system_, _Azure blob storage_ or _Amazon S3_). See [Configuring file system](https://docs.kentico.com/13/custom-development/working-with-physical-files-using-the-api/configuring-file-system-providers.md) providers for more information.

Click **Clear debug log** to remove all data in the IO debug.

### Event handlers

On the **Event handlers** tab of the debugging interface, you can find a list of all events that the system triggered while processing recent requests.

> **Info:** For more information, see:
>
> - [Handling global events](https://docs.kentico.com/13/custom-development/handling-global-events.md)
> - [Reference - Global system events](https://docs.kentico.com/13/custom-development/handling-global-events/reference-global-system-events.md)

Click **Clear debug log** to delete the current data in the event debug (for all requests).
