Tracing
PPJ includes diagnostic trace calls grouped by subsystem. Trace coverage and message detail depend on the installed runtime; the tracing system was introduced in the PPJ 2010 line.
There are seven trace sources defined in the PPJ Framework:
- SQL
- Windows
- TableWindows
- Files
- Reports
- System
- Application
Each trace switch has five settings: Off and four increasing diagnostic 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. 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:
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.
| Source | Description |
|---|---|
| SQL | SQL operations, including parsing, execution, fetching data, exceptions. |
| Windows | SAL and Windows events. |
| TableWindows | Table Windows operations, including populating, creating rows, columns, etc. |
| Files | All files operation and exceptions. |
| Reports | Reporting operations including loading a report, input variables parsing and binding, printing viewing, and errors. |
| System | System events, including startup, shutdown, SalCompileAndEvaluate and bind variables resolution and read/write operations, unhandled exceptions, etc. |
| Application | Application's generated traces. |
Collecting a Useful Trace
Trace call → subsystem switch allows this level? → configured listener → destination
│
└─ no → no output for that call
An Info-level SQL switch permits Error, Warning, and Info messages, but excludes Verbose. A listener then determines where permitted messages go. If no useful output appears, check the selected subsystem, the switch level, the listener, and its destination permissions separately.
Enable the relevant switch and configure a listener: a level alone does not choose an output destination. Reproduce one operation, capture its time and relevant identifiers, and then restore normal logging levels. SQL and application traces can contain business data; avoid logging credentials and limit retention.
Verbose output can affect timing, disk usage, and responsiveness. Measure under realistic load rather than assuming tracing has no cost.
For a failed lookup, enable SQL and, if symbol resolution is involved, System tracing. Record one reproducible action with a timestamp or safe correlation ID. Read the trace from preparation through execution and fetch: the last visible SQL statement is not necessarily the operation that failed. Restore normal levels after collecting the evidence.