Easysoft Data Access

How do I turn unixODBC tracing on or off?

Last Reviewed:
4th January 2024

To enable unixODBC tracing, add the following section to your odbcinst.ini file. To locate odbcinst.ini, type odbcinst -j. (If you are using the version of unixODBC that is included in Easysoft ODBC driver distributions, by default, odbcinst is in the /usr/local/easysoft/unixODBC/bin directory.) Note that the permissions on odbcinst.ini may make it necessary for you to be the root user to make changes.

# To enable unixODBC tracing, add this section to odbcinst.ini.
# Include the [ODBC] section heading.
Trace = yes
TraceFile = trace_file_path

where trace_file_path is the path of the file you want log entries to be written to. For example, /tmp/sql.log. If the file does not exist, the Driver Manager will create it.

Note that running ODBC applications as different users may affect tracing. This is because most users will set their umask in a way that prevents other users from writing to newly created files. For example, user A enables tracing and connects to the Driver Manager, creating a new trace file. When user B uses the Driver Manager, it is likely nothing will be traced because user B does not have write permission to the trace file.

As tracing will slow your application down, remember to turn tracing off when you have finished debugging. To do this, either remove the previous lines from your odbcinst.ini file or make the following change:

Trace = no

For information about the format of trace file entries, see the Linux/UNIX ODBC article.

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)