The driver code includes a packet logging mechanism that allows you to log TCP packets transmitted between your driver and database over the network layer. The logs compiled from can then be analyzed and used to troubleshoot issues. You can enable and configure logging using driver connection options.

Note: The packet logging mechanism is supported only for drivers that transmit TCP packets. Refer to Packet logging in the Progress DataDirect for ODBC Drivers Reference for a list of supported drivers.

See the following "Packet Logging Connection options" section for a list of connection options used to configure packet logging.

To enable TCP packet logging:

  1. Configure and enable packet logging using one of the following methods: See the following "Configuring and enabling packet logging" section for details.
  2. Start your application and reproduce the issue.
  3. Stop the application and disable packet logging.
  4. Send your logs to Technical Support for analysis. Optionally, you can view your logs using a text editor.

Configuring and enabling packet logging

The following driver configuration methods can be used to enable and configure packet logging. Note that only the EnablePacketLogging connection option is required to enable packet logging. If you do not specify values for the other connection options for packet logging, the default behavior is used.

Driver setup dialog (Windows)

You can specify connection options for packet logging in the Extended Options field of the Advanced tab. For example:

EnablePacketLogging=1;PacketLoggingFilePrefix=C:\temp\myPacketLog;
PacketLoggingMaxFileSize=7500

odbc.ini file (UNIX/Linux)

In your data source definition in the [ODBC Data Sources] section of the system information file, you can specify connection options that control packet logging.

[PostgreSQL Wire Protocol]
Driver=ODBCHOME/lib/ivpsql28.so
Description=DataDirect 8.0 PostgreSQL Wire Protocol
...
Database=MyDB
...
EnablePacketLogging=1
...
HostName=MyServer
...
LogonID=JOHN
...
PacketLoggingFilePrefix=/tmp/myPacketLog
...
PacketLoggingMaxFileSize=102400
...
PacketLoggingMaxNumFiles=10
...
Password=secret
...
PortNumber=5432
...

Connection string

You can specify connection options that configure packet logging in connection strings.

DRIVER=DataDirect 8.0 PostgreSQL Wire Protocol;HostName=MyServer;
Database=MyDB;PortNumber=5432;LogonID=JOHN;Password=secret;
EnablePacketLogging=1;PacketLoggingFilePrefix=C:\temp\myPacketLog;

Packet logging connection options

The following table describes the connection options used to configure packet logging.

Table 1. Packet Logging Connection Options
Option Description
EnablePacketLogging

If set to 0, packet logging is disabled. This is the default.

If set to 1, packet logging is enabled.

If set to 2, packet logging is enabled, but the generated log file does not contain packet data. This value is typically used for performance testing.

(Windows only) If set to 5, packet logging and ODBC tracing are enabled.

If set to 6, packet logging and ODBC tracing are enabled, but the log file for packet logging does not contain data.

PacketLoggingFlush

If set to 0, the operating system determines when to write the log content stored in memory to disk. This is the default.

If set 1, the driver determines when to write the log content stored in memory to disk.

If set to 2, the content of memory is written to a the log file after each write. This setting provides a more complete logging history in the event of a crash, but can incur a performance penalty.

PacketLoggingFilePrefix

Specifies the path and prefix name of the log file. If no path is specified, the trace log resides in the working directory of the application you are using. For example:

  • /tmp/myLogFile (UNIX/Linux)
  • C:\temp\myLogFile (Windows)

The above examples would generate a file named myLogFileYYYYMMDDhhmmssxxx_nn.out in the temp directory.

If you do not specify a value for this option, the driver creates log files in the working directory using the following form: pktYYYYMMDDhhmmssxxx_nn.out.

PacketLoggingMaxFileSize

Specifies the file size limit (in KB) of the log file. Once this file size limit is reached, a new log file is created and logging continues. The default is 102400.

Note that subsequent files are named by appending sequential numbers, starting at 1, to the end of the original file name, for example, myLog<timestamp>_1.out, myLog<timestamp>_2.out, and so on.

PacketLoggingMaxNumFiles

Specifies the maximum number of log files that can be created. The default is 10.

Once the maximum number of log files is created, the logging mechanism reopens the first file in the sequence, deletes the content, and continues logging in that file until the file size limit is reached, after which it repeats the process with the next file in the sequence.

PacketLoggingMemBuffSize

Specifies the maximum amount of memory, in kiloybtes, to use when writing packet logging. The default is 1024.