Configuring Logging for the Current Connection

You can configure logging for the current connection by setting the logging configuration properties in the DSN or in a connection string. For information about the logging configuration properties, see Configuring Logging Options. Settings in the connection string take precedence over settings in the DSN, and settings in the DSN take precedence over connector-wide settings.

Note:

If the LogLevel configuration property is passed in via the connection string or DSN, the rest of the logging configurations are read from the connection string or DSN and not from the existing connector-wide logging configuration.

To configure logging properties in the DSN, you must modify the Windows registry. For information about the Windows registry, see the Microsoft Windows documentation.

Important:

Editing the Windows Registry incorrectly can potentially cause serious, system-wide problems that may require re-installing Windows to correct.

To add logging configurations to a DSN:

  1. On the Start screen, type regedit, and then click the regedit search result.
  2. Navigate to the appropriate registry key for the bitness of your connector and your machine:
    • 32-bit System DSNs: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBC.INI\[DSN Name]
    • 64-bit System DSNs: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\[DSN Name]
    • 32-bit and 64-bit User DSNs: HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\[DSN Name]
  3. For each configuration option that you want to configure for the current connection, create a value by doing the following:
    1. If the key name value does not already exist, create it. Right-click the [DSN Name] and then select New > String Value, type the key name of the configuration option, and then press Enter.
    2. Right-click the key name and then click Modify.
    3. To confirm the key names for each configuration option, see Connector Logging Configuration Options.

    4. In the Edit String dialog box, in the Value Data field, type the value for the configuration option.
  4. Close the Registry Editor.
  5. Restart your ODBC application to make sure that the new settings take effect.