Configuring Logging Options
To help troubleshoot issues, you can enable logging in the connector.
You can set the connection properties described below in a connection string, in a DSN (in the odbc.ini
file), or as a connector-wide setting (in the simba.amazonredshiftodbc.ini file). Settings in the connection string take precedence over
settings in the DSN, and settings in the DSN take precedence over connector-wide settings.
To enable logging:
- To specify the level of information to include in log files, set the
LogLevelproperty to one of the following numbers:LogLevel Value Description 0Disables all logging.
1Logs severe error events that lead the connector to abort.
2Logs error events that might allow the connector to continue running.
3Logs events that might result in an error if action is not taken.
4Logs general information that describes the progress of the connector.
5Logs detailed information that is useful for debugging the connector.
6Logs all connector activity.
- Set the
LogPathkey to the full path to the folder where you want to save log files. - Set the
LogFileCountkey to the maximum number of log files to keep.Note: After the maximum number of log files is reached, each time an additional file is created, the connector deletes the oldest log file.
- Set the
LogFileSizekey to the maximum size of each log file in bytes.Note: After the maximum file size is reached, the connector creates a new file and continues logging.
- Optionally, to prefix the log file name with the user name and process ID associated with the connection, set the
UseLogPrefixproperty to1. - Save the
simba.amazonredshiftodbc.iniconfiguration file. - Restart your ODBC application to make sure that the new settings take effect.
The Simba Amazon Redshift ODBC Connector produces the following log files at the location you specify using the LogPath key:
- A
redshiftodbcdriver.logfile that logs connector activity that is not specific to a connection. - A
redshiftodbcdriver_connection_[Number].logfile for each connection made to the database, where [Number] is a number that identifies each log file. This file logs connector activity that is specific to the connection.
If you set the UseLogPrefix property to 1, then each file name is prefixed with [UserName]_[ProcessID]_, where [UserName] is the user name associated with the connection and [ProcessID] is the process ID of the application through which the connection is made. For more information, see UseLogPrefix.
To disable logging:
- Open the
simba.amazonredshiftodbc.iniconfiguration file in a text editor. - Set the
LogLevelkey to0. - Save the
simba.amazonredshiftodbc.iniconfiguration file. - Restart your ODBC application to make sure that the new settings take effect.