informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_tracefile_set()

The mi_tracefile_set() function sets the trace-output file, where the database server writes trace messages.

Syntax

Usage

The mi_tracefile_set() function sets the trace-output file to the path that filename references. The database server writes trace messages to this file when it encounters a trace statement in a UDR and the following conditions are true:

For information on how to turn on a trace class, see the description of the mi_tracelevel_set() function.

If you do not call mi_tracefile_set(), the database server writes trace output to a system-defined trace-output file with the session identifier and a .trc file extension. You can obtain the current session identifier with the onstat -g ses command.

On a UNIX platform, the system-defined trace file resides in the /tmp directory with the following filename:

In the preceding format, session_id is a system-assigned session identifier.

On a Windows NT system, the system-defined trace file is:

In the preceding pathname, $DRIVER is the driver on which the Informix product is installed and session_id is a system-assigned session identifier.

You can change the destination of trace messages with the mi_tracefile_set() function. When you use mi_tracefile_set() to specify the trace-output file, the database server first attempts to append trace messages to that file. If the file that filename references does not exist, the database server creates a new trace-output file with the name filename. You must ensure that the directory where filename resides provides the user others or public with read and write permission.

The filename can specify a full pathname or just a filename. If you specify only a filename, the DataBlade API puts the file in the working directory of the server environment. This directory is the one in which the oninit (or its equivalent) was executed to start up the database server. If mi_tracefile_set() receives an invalid filename, it creates a system-defined trace file.

Return Values

MI_OK indicates that the function was successful.
MI_ERROR indicates that the function was not successful.

Example

The following example sets the trace file name to test14_may2.trc in the /d2/udr/tests directory:

Related Topics

See the description of the mi_tracelevel_set() function.

For more information, see Specifying the Trace-Output File.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved