Logging and Environment Variables
This chapter describes some tools you can use to perform troubleshooting. It discusses the following topics:
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.
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:
To enable logging for the client driver, use the IRISODBCTRACE environment variable (as described later in “ODBC Environment Variables”). Also configure the ODBC initialization file.
To enable logging for the driver manager, set the Trace entry in the ODBC initialization file (see “Structure of the ODBC Initialization File” in “Using an InterSystems Database as an ODBC Data Source on UNIX®”). In the same file, the TraceFile entry specifies the name of the log file to create.
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.
This variable allows you to specify the duration of a timeout for a default login. Its value is in seconds.
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.
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.
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.