> For the complete documentation index, see [llms.txt](https://docs.iceteagroup.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iceteagroup.com/general/framework/tracing.md).

# Tracing

The PPJ Framework starting from version 2010 has been instrumented with a granular system of trace calls (we will fine tune it and improve the location and details of the trace calls in future builds and major version releases.)

There are seven trace sources defined in the PPJ Framework:

1. SQL
2. Windows
3. TableWindows
4. Files
5. Reports
6. System
7. Application

Each source can be set to one of 4 different levels:

* Off (Default) = 0
* Error = 1
* Warning = 2
* Info = 3
* Verbose = 4

## Enable tracing in {app}.exe.config

To enable tracing in the application's configuration file you can edit it with a text editor or by using our [configuration tool](https://iceteagroup.com/docs/html/tracing2.htm). In this case the application needs to be restarted.

## Enable Tracing at Runtime

Tracing can be enabled programmatically at any time by simply changing the TraceLevel assigned to the trace source.

For example, to enable SQL tracing at runtime use the following code:

```csharp
Sys.TraceSQL.Level  = TraceLevel.Info;
```

## Trace Sources

In the following table you can find a description of the kind of activity that is traced for each switch.

<table><thead><tr><th width="223">Source</th><th>Description</th></tr></thead><tbody><tr><td>SQL</td><td>SQL operations, including parsing, execution, fetching data, exceptions.</td></tr><tr><td>Windows</td><td>SAL and Windows events.</td></tr><tr><td>TableWindows</td><td>Table Windows operations, including populating, creating rows, columns, etc.</td></tr><tr><td>Files</td><td>All files operation and exceptions.</td></tr><tr><td>Reports</td><td>Reporting operations including loading a report, input variables parsing and binding, printing viewing, and errors.</td></tr><tr><td>System</td><td>System events, including startup, shutdown, SalCompileAndEvaluare and bind variables resolution and read/write operations, unhandled exceptions, etc.</td></tr><tr><td>Application</td><td>Application's generated traces.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.iceteagroup.com/general/framework/tracing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
