• Topic
  • Discussion
  • UdaWikiWeb.UDAADOTracing(Last) -- Owiki? , 2016-08-19 15:01:07 Edit owiki 2016-08-19 15:01:07

    Call Tracing with our ADO.NET Providers

    To enable tracing using any of our ADO.Net Providers, create an environment variable called OPL.NET.TRACE.CONFIG, which targets a text file (which you'll create shortly); for example, on Windows:

    set OPL.NET.TRACE.CONFIG=C:\Program Files\OpenLink Software\UDA\adotrace.cfg
    


    This text file will contain structured XML as described (and with examples) below, with three key elements:

    • provider -- specified by classname, as shown in the examples below
    • tracelevel -- specified by values shown, in increasing level of detail; defaults to none if omitted


      tracelevel ::= None | Exception | Warning | Info | Call | InternalCall | Debug

    • tracefile -- filename prefix for tracefile. If omitted, trace output will be directed to the console. The filename prefix can include a path, either absolute or relative to the client application's working directory.

    The output tracefile will be named in this form --

    <filename prefix>_<application domain name>_<process id>_<application domain id>_<provider name>.log
    


    Trace output will be written to the specified log file in the form --

    <time> [<thread id>:<stack depth>] <object name>.<method>: <context>
    

    -- where context may be --

    • ENTRY -- method entry
    • EXIT -- method exit
    • EXCEPTION -- exception thrown
    • MESSAGE -- general trace message

    A thread's exit from a method is not shown unless the method has a non-void return type or output parameters (e.g., ref or out parameters in C#). When not shown, the method will have exited before the first subsequent entry in the trace output where the thread's stack depth is less than its stack depth when the method was entered.

    The following sample %OPL.NET.TRACE.CONFIG% would trace calls from all OpenLink ADO.NET Providers --

    <providers>
    
      <!-- Single-Tier ADO.NET Provider for ODBC Data Sources -->
      <provider name="OpenLink.Data.OdbcClient">
        <tracelevel>
            Debug
        </tracelevel>
        <tracefile>
            c:\trace_odbc
        </tracefile>
      </provider>
    
      <!-- Single-Tier ADO.NET Provider for Microsoft SQL Server Data Sources -->
      <provider name="OpenLink.Data.SQLServer">
        <tracelevel>
            Debug
        </tracelevel>
        <tracefile>
            c:\trace_sql
        </tracefile>
      </provider>
    
      <!-- Single-Tier ADO.NET Provider for Sybase Data Sources -->
      <provider name="OpenLink.Data.Sybase">
        <tracelevel>
            Debug
        </tracelevel>
        <tracefile>
            c:\trace_syb
        </tracefile>
      </provider>
    
      <!-- Multi-Tier Generic Client ADO.NET Provider -->
      <provider name="OpenLink.Data.GenericClient">
        <tracelevel>
            Debug
        </tracelevel>
        <tracefile>
            c:\trace_generic
        </tracefile>
      </provider>
    
      <!-- Single-Tier ADO.NET Provider for Virtuoso -->
      <provider name="OpenLink.Data.Virtuoso">
        <tracelevel>
            Debug
        </tracelevel>
        <tracefile>
            c:\trace_virtuoso
        </tracefile>
      </provider>
    
    </providers>
    

    Referenced by...