Configuring Connector-wide Logging Options

To help troubleshoot issues, you can enable logging in the connector or in the wire protocol component. In addition to these forms of logging supported by the Simba SQL Server ODBC Driver, the ODBC Data Source Administrator provides tracing functionality.

Important: Only enable logging or tracing long enough to capture an issue. Logging or tracing decreases performance and can consume a large quantity of disk space.

The settings for logging apply to every connection that uses the Simba SQL Server ODBC Driver, so make sure to disable the feature after you are done using it. To configure logging for the current connection, see Configuring Logging for the Current Connection.

Connector Logging

Use connector logging to track the activity in the Simba SQL Server ODBC Driver. You can specify the amount of detail included in the log files. The table below lists the logging levels that are available, in order from least verbose to most verbose.

Logging Level Description

OFF

Disables all logging.

FATAL

Logs severe error events that lead the connector to abort.

ERROR

Logs error events that might allow the connector to continue running.

WARNING

Logs events that might result in an error if action is not taken.

INFO

Logs general information that describes the progress of the connector.

DEBUG

Logs detailed information that is useful for debugging the connector.

TRACE

Logs all connector activity.

To enable connector logging:

  1. To access logging options, open the ODBC Data Source Administrator where you created the DSN, then select the DSN, then click Configure, and then click Logging Options.
  2. In the Log Level drop-down list, select the desired level of information to include in log files.
  3. In the Log Path field, type the full path to the folder where you want to save log files.
  4. In the Max Number Files field, type 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.
  5. In the Max File Size field, type the maximum size of each log file in megabytes (MB).
    Note: After the maximum file size is reached, the connector creates a new file and continues logging.
  6. Click OK.
  7. Restart your ODBC application to make sure that the new settings take effect.

The Simba SQL Server ODBC Driver produces the following log files at the location you specify using the LogPath key:

  • A simbasqlserverodbcdriver.log file that logs connector activity that is not specific to a connection.
  • A simbasqlserverodbcdriver_connection_[Number].log file 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 enable the UseLogPrefix connection property, the connector prefixes the log file name with the user name associated with the connection and the process ID of the application through which the connection is made. For more information, see UseLogPrefix.

To disable connector logging:

  1. To access logging options, open the ODBC Data Source Administrator where you created the DSN, then select the DSN, then click Configure, and then click Logging Options.
  2. In the Log Level drop-down list, select LOG_OFF.
  3. Click OK.

Wire Protocol Component Logging

Use wire protocol component logging to track the data activity between the connector and the SQL Server instance. You can specify the amount of detail to include in the log files. The table below lists the logging levels that are available, in order from least verbose to most verbose.

Logging Level Description

0

Disables all logging.

1

Logs error events that might allow the wire protocol component to continue running. 1 is the default logging level.

2

Logs general information that describes the progress of the wire protocol component.

3

Logs detailed information that is useful for debugging the wire protocol component.

4

Logs all activity in the wire protocol component.

Wire protocol component logging is configured through the TDSTRACE environment variable.

To enable wire protocol component logging:

  1. Open the System Information dialog box:
    • If you are using Windows 7 or earlier, click Start Windows Start button, then right-click Computer, and then click Properties.
    • Or, if you are using Windows 8 or later, on the Start screen, right-click This PC and then click Properties.
  2. Click Advanced System Settings.
  3. In the System Properties dialog box, click the Advanced tab and then click Environment Variables.
  4. Choose one:
    • If the TDSTRACE variable already exists in the System Variables list, select it and then click Edit.
    • Or, if the TDSTRACE variable does not appear in the System Variables list, click New and then in the Variable Name field type TDSTRACE.
  5. In the Variable Value field, type [LoggingLevel]:[LogFilePath], where [LoggingLevel] is the logging level indicating the amount of detail to include in the log file and [LogFilePath] is the full path of the log file.

    For example, the value 3:C:\Logs\MyWireLog.log configures the wire protocol component to log debugging information in a file named MyWireLog.log located in the C:\Logs folder.

  6. To save your changes and close the Edit System Variable dialog box, click OK
  7. Click OK to close the Environment Variables dialog box, and then click OK to close the System Properties dialog box.

To disable wire protocol component logging:

  1. Open the System Information dialog box:
    • If you are using Windows 7 or earlier, click Start Windows Start button, then right-click Computer, and then click Properties.
    • Or, if you are using Windows 8 or later, on the Start screen, right-click This PC and then click Properties.
  2. Click Advanced System Settings.
  3. In the System Properties dialog box, click the Advanced tab and then click Environment Variables.
  4. Select TDSTRACE from the System Variables list and then click Edit.
  5. In the Variable Value field, replace the existing value with 0.
  6. To save your changes and close the Edit System Variable dialog box, click OK.
  7. Click OK to close the Environment Variables dialog box, and then click OK to close the System Properties dialog box.

ODBC Tracing

You can use the ODBC Data Source Administrator to trace connection activity in the ODBC layer.

To start tracing using the ODBC Data Source Administrator:

  1. In the ODBC Data Source Administrator, click the Tracing tab.
  2. In the Log File Path area, click Browse. In the Select ODBC Log File dialog box, browse to the location where you want to save the log file, then type a descriptive file name in the File name field, and then click Save.
  3. On the Tracing tab, click Start Tracing Now.

To stop ODBC Data Source Administrator tracing:

  • In the ODBC Data Source Administrator, on the Tracing tab, click Stop Tracing Now.

For more information about tracing using the ODBC Data Source Administrator, see "How to Generate an ODBC Trace with ODBC Data Source Administrator" on the Microsoft Support website: http://support.microsoft.com/kb/274551.