OceanBase Connector/ODBC supports logging. This topic describes how to enable logging in Windows and Linux.
Enable logging in Linux
You can add the OPTION=4 setting to the odbc.ini configuration file to enable logging. Logs are stored in the /tmp/obodbc.log directory by default. You can also run the following commands to respectively enable and disable logging. The commands are prior to the setting in the odbc.ini configuration file. If you do not run the following commands, the setting in the driver manager is used.
export ODBC_LOG_ENABLE=true
export ODBC_LOG_ENABLE=false
After logging is enabled, run the following command to set a log path.
export ODBC_LOG_DIR=/home
Then add the following information to the odbcinst.ini configuration file for data source name (DSN) logging.
[ODBC]
Trace=YES
TraceFile=/odbc.log
Enable logging in Windows
When you add a DSN on the ODBC Data Source Administrator page, select Debug in the Cursor/Results section to enable logging. The obodbc.log file is stored in a temporary directory by default.

You can also set the ODBC_LOG_ENABLE environment variable to enable or disable logging. This environment variable is prior to the setting in the driver manager. If it is not specified, the setting in the driver manager is used.
ODBC_LOG_ENABLE=true
ODBC_LOG_ENABLE=false
After you enable logging by setting the environment variable, set ODBC_LOG_DIR to specify a log path.
ODBC_LOG_DIR=/home
Then configure DSN logging, enable tracing, and set a file path on the ODBC Data Source Administrator page.
