|
The .NET Framework provides a Trace class that can help end users identify the problem without the program having to be recompiled.
The Pervasive.SQL data provider delivers additional diagnostic capability:
Developers can use the Trace class to help debug problems during development. You can use the properties and methods of the Trace class to help isolate problems and fix them without disturbing a running system.
The Pervasive.SQL data provider delivers additional tracing capability. The data provider traces the input arguments to all of its public method calls, as well as the outputs and returns from those methods (anything that a user could potentially call). Each call contains trace entries for entering and exiting the method. Provider-specific methods allow the data provider to trace all its method calls to a user-specified trace file.
Set the following environment variables to enable and control tracing:
NOTE: SettingEnableTrace = 1 starts the tracing process. Therefore, you must define the property values for the trace file before setting EnableTrace. Once the trace processing starts, the values of TraceFile and RecreateTrace cannot be changed.
The following C# code fragment uses static methods in the Trace class to specify a trace file named MyTrace.txt. The values set override the values set in the environmental variables. All subsequent calls to the data provider will be traced to MyTrace.txt.
The trace output has the following format:
<Correlation#> <Timestamp> <CurrentThreadName> <Object Address> <ObjectName.MethodName> ENTER (or EXIT) Argument #1 : <Argument#1 Value> Argument #2 : <Argument#2 Value> ... RETURN: <Method ReturnValue> // This line only exists for EXIT
where Correlation# is a unique number that can be used to match up ENTER and EXIT entries for the same method call in an application, and Value is the hash code of an object appropriate to the individual function calls.
During debugging, sensitive data can be read, even if it is stored as private or internal variable and access is limited to the same assembly. To maintain security, trace logs show passwords as five asterisks (*****).
The Performance Monitor utility in the Windows operating system allows you to record application parameters and review the results as a report or graph. You can also use Performance Monitor to identify the number and frequency of CLR exceptions in your applications.
The Pervasive.SQL data provider installs a set of PerfMon counters that let you tune and debug applications that use the data provider. The data provider's counters are located in the Performance Monitor under the category name Pervasive.SQL .NET Data Provider.
Table 2-7 describes the PerfMon counters that you can use to tune connections for your application.
For information on using PerfMon and performance counters, refer to the Microsoft documentation library.
|
Chapter contents
Prev topic: Error Handling
|