Learning
Community
Open Exchange
Global Masters
InterSystems IRIS Data Platform 2019.3 / Application Development / Using the InterSystems ODBC Driver / Logging and Environment Variables
Previous section   

Logging and Environment Variables

This chapter describes some tools you can use to perform troubleshooting. It discusses the following topics:
Caution:
Enable logging only when you need to perform troubleshooting. You should not enable logging during normal operation, because it will dramatically slow down performance.

ODBC Logging on Windows

To enable logging for an ODBC data source on Windows, use the ODBC Data Source Administrator to change the logging information in the DSN (see “Creating a DSN with the ODBC Data Source Administrator” for detailed usage information). In the ODBC Data Source Administrator, make the following changes:
  • To enable logging for the client driver, find the definition of the DSN that you want to log, open it, and check the box labeled ODBC Log (or Log or variations).
  • To enable logging for the driver manager, click the Tracing tab and then click the Start Tracing Now button. The Log File Path field determines the name and location of the trace file.
Note:
The default log file name is IRISODBC.log, and the default location is C:\Users\Public\Logs. You can change these values by setting the IRISODBCTRACEFILE environment variable (see “ODBC Environment Variables” later in this chapter).

ODBC Logging on UNIX®

On UNIX®, enable logging for ODBC as follows:
Tip:
If you enable logging but the log file is not updated, either you might not have privileges to write to the file or the client application may have loaded the SO before you enabled logging. In the latter case, stop and restart the client application to force it to reload the SO and get the logging flag.

ODBC Environment Variables

This section describes the environment variables that control the InterSystems ODBC client driver. Typically you use these only for debugging or diagnostics.
IRISODBCDEFTIMEOUT
This variable allows you to specify the duration of a timeout for a default login. Its value is in seconds.
IRISODBCPID
This boolean variable controls the automatic appending of the process ID number to the log file name. Set the value to 1 to enable appending, or 0 to disable. By default, appending is off.
With IRISODBCPID enabled, if the base log file is IRISODBC.log and is in your current directory, then the process ID of 21933 generates a full log file name of IRISODBC.log.21933.
Both IRISODBCPID and IRISODBCTRACEFILE affect the file name. For example, on Windows if you use IRISODBCTRACEFILE to set the base file name of the log file (for instance, to C:/home/mylogs/mylog.txt and enable IRISODBCPID, then log file names will be of the form C:/home/mylogs/mylog.txt.21965.
IRISODBCTRACE (UNIX® Only)
This boolean variable controls client driver logging. Set the value to 1 to enable client driver logging, or 0 to disable. For more information, see “ODBC Logging on UNIX®” earlier in this chapter.
IRISODBCTRACEFILE
This variable specifies the location and name of the log file. This can be useful for placing the log file in a unique directory or giving it a unique name. The default name for the log file is IRISODBC.log. The default location is as follows:
  • For UNIX®, the log is generated in the current directory by default.
  • For Windows, the default location for the log file is %PUBLIC%\Logs. This directory is accessible by all users and allows just one location for the log to be created.
IRISODBCTRACETHREADS
This variable controls whether the log also includes threading information. Set the value to 1 to enable inclusion of threading information, or 0 to disable.
It can be useful to enable this additional kind of logging, if you need to debug a threaded application. However, it adds many extra lines to the log for most ODBC applications.
Previous section