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:
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
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.
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.
Analysis of the results is performed using PerfView.
Refer to the Microsoft PerfView documentation for more information.
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 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.