Packet logging
- Last Updated: June 21, 2024
- 2 minute read
- DataDirect Connectors
- ODBC
- Amazon Redshift 8.0
- Documentation
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.
See the following "Packet Logging Connection options" section for a list of connection options used to configure packet logging.
To enable TCP packet logging:
- Configure and enable packet logging using one of the following methods: See the following "Configuring and enabling packet logging" section for details.
- Start your application and reproduce the issue.
- Stop the application and disable packet logging.
- 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.
[Amazon Redshift Wire Protocol]
Driver=ODBCHOME/lib/ivrsft28.so
Description=DataDirect 8.0 Amazon Redshift Wire Protocol
...
Database=MyDB
...
EnablePacketLogging=1
...
HostName=RedshiftServer
...
LogonID=JOHN
...
PacketLoggingFilePrefix=/tmp/myPacketLog
...
PacketLoggingMaxFileSize=102400
...
PacketLoggingMaxNumFiles=10
...
Password=secret
...
PortNumber=5439
...
Connection string
You can specify connection options that configure packet logging in connection strings.
DRIVER={DataDirect 8.0 Amazon Redshift Wire Protocol};HostName=RedshiftServer;PortNumber=5439;
LogonID=JOHN;Password=secret;Database=MyDB;EnablePacketLogging=1;
PacketLoggingFilePrefix=C:\temp\myPacketLog;
Packet logging connection options
The following table describes the connection options used to configure packet logging.
| Option | Description |
|---|---|
EnablePacketLogging |
If set to If set to If set to (Windows only) If set to If set to |
PacketLoggingFlush |
If set to If set If set to |
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:
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,
|
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 |