.NET Tracing Support

The SAP Sybase IQ .NET Data Provider supports tracing using the .NET tracing feature.

By default, tracing is disabled. To enable tracing, specify the trace source in your application's configuration file.

The following is an example of a configuration file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
 <source name="iAnywhere.Data.SQLAnywhere" 
         switchName="SASourceSwitch" 
         switchType="System.Diagnostics.SourceSwitch">
  <listeners>
   <add name="ConsoleListener" 
        type="System.Diagnostics.ConsoleTraceListener"/>
   <add name="EventListener" 
        type="System.Diagnostics.EventLogTraceListener" 
        initializeData="MyEventLog"/>
   <add name="TraceLogListener" 
        type="System.Diagnostics.TextWriterTraceListener" 
        initializeData="myTrace.log" 
        traceOutputOptions="ProcessId, ThreadId, Timestamp"/>
   <remove name="Default"/>
  </listeners>
 </source>
</sources>
<switches>
 <add name="SASourceSwitch" value="All"/>
 <add name="SATraceAllSwitch" value="1" />
 <add name="SATraceExceptionSwitch" value="1" />
 <add name="SATraceFunctionSwitch" value="1" />
 <add name="SATracePoolingSwitch" value="1" />
 <add name="SATracePropertySwitch" value="1" />
</switches>
</system.diagnostics>
</configuration>

There are four types of trace listeners referenced in the configuration file shown above.

To disable tracing to any of the trace listeners described above, remove the corresponding add entry under <listeners>.

The trace configuration information is placed in the application's project folder in the App.config file. If the file does not exist, it can be created and added to the project using Visual Studio by choosing Add » New Item and selecting Application Configuration File.

The traceOutputOptions can be specified for any listener and include the following:

The example configuration file, shown earlier, specifies trace output options for the TextWriterTraceListener only.

You can limit what is traced by setting specific trace options. By default the numeric-valued trace option settings are all 0. The trace options that can be set include the following:

For more information, see "Tracing Data Access" at http://msdn.microsoft.com/en-us/library/ms971550.aspx.