Send feedback on this topic.
Teradata.Client.Provider
Logging and Tracing on Windows
.NET Data Provider for Teradata > Developer's Guide > Product Support, Troubleshooting and Error Messages > Troubleshooting > Logging and Tracing on Windows

Logging and Tracing for the .NET Data Provider for Teradata uses Event Tracing for Windows (ETW). The logging process can be broken into 3 stages as follows:

  1. Configure what you want to log
  2. Start/Stop logging
  3. Analyze the results

Logman should already be installed in the current path of any Windows system.

PerfView can be downloaded from https://github.com/Microsoft/perfview/blob/master/documentation/Downloading.md

Configure

The best way to configure what you want to log is to create a TeradataLogging.config file in the same directory as your application executable. You may use this example file as a template.

Alternatively you may specify the Keywords and Level, as optional parameters, when you start the logging. This method is rather cryptic and does not allow you to specify a maximum size for the logging of data message contents. In this case the size would always be 1024 bytes.

Start/Stop

Logging can be started and stopped using either Logman or PerfView.

Unless you want to log all the core .NET functionality, in addition to the .NET Data Provider for Teradata functionality, it is recommended that you use logman. The log files created by PerfView will be dramatically larger than those created by Logman.

To start/stop logging using Logman:

  1. Open a command prompt
  2. Execute the following command:
          logman start tdlog -o <filename> -p {1fe8e806-d875-5a74-2c3f-94b5f004de00} <keywords> <level> -ets
    The file name must be of the form *.etl.
    See below for the description of the keywords and level.
    The keywords and level are only required if you do not provide a config file.
  3. Launch your application
  4. After your application completes, or logging is no longer required, execute the following command:
          logman stop tdlog -ets

To start/stop logging using PerfView:

  1. Launch PerfView
  2. Click the Collect, Collect menu
  3. Click Yes if prompted by a UAC dialog
  4. Enter a File name [*.etl] and Directory in the fields provided
  5. Click the drop-down arrow for Advanced Options
  6. Type the following in the Additional Providers field:
        *Teradata-Data-Provider:<keywords>:<level>
    See below for the description of keywords and level.
    The keywords and level are only required if you do not provide a config file.
  7. Click the Start Collection button
  8. Launch your application
  9. After your application completes, or logging is no longer required, click the Stop Collection button
  10. After a short time, your new file should appear in the tree to the left.

Analyze

Analysis of the results is performed using PerfView.

  1. Launch PerfView
  2. Use the combo box at top left to enter, or navigate to, the directory containing your *.etl file
  3. Double click your log file in the list that appears below
  4. Double click the Events node below your log file

Refer to the Microsoft PerfView documentation for more information.


Levels

The level is a numeric value between 1 and 6.

      1 - Logs Error Messages
      2 - Logs Warning and Error Messages
      3 - Logs Informational, Warning and Error Messages
      4 - Logs Trace [External], Informational, Warning and Error Messages
      5 - Logs Trace [Internal and External], Informational, Warning and Error messages
      6 - Logs Debug, Trace, Informational, Warning and Error Messages


Keywords

Keywords are used to specify the components you wish to log when you are not using a configuration file. They are numeric values that may be added together to specify that multiple components are to be logged.

Component Keyword Description
MessageData 0x0001 Log the data buffers for all messages sent to or from Teradata. The first 1024 bytes will be logged unless you use the configuration file to change that limit.
Command 0x0002 Log information related to Command objects
Connection 0x0004 Log information related to Connection objects
DataAdapter 0x0008 Log information related to DataAdapter objects
DataReader 0x0010 Log information related to DataReader objects
TdError 0x0020 Log information related to TdError objects
Exception 0x0040 Log information related to Exceptions
Lobs 0x0080 Log information related to Large Objects
Parameter 0x0100 Log information related to Parameter objects
Transaction 0x0200 Log information related to Transactions
TdTypes 0x0400 Log information related to Teradata specific Data Types
Session 0x0800 Log information related to Session objects
SchemaCollections 0x1000 Log information related to Schema Collections
SocketsDNS 0x2000 Log information related to Concurrent Sockets and related Domain Name System (DNS) interactions. For example the log entries will show "Data Source DNS Entries" (a.k.a. Number of COPS) associated with the Data Source and the order in which the COPs (IP Addresses) are used to establish connections to the Teradata Database.
EntityProvider 0x4000 Log information related to the Entity Data Provider

The value used with PerfView or Logman should be 0xF00000000000 plus the sum of the components you wish to log.

For example, use 0xF00000000015 to log Data Messages plus Connection and DataReader components.