TSL_SetLogMode function

The TSL_SetLogMode function specifies how messages about the loader are logged.

Syntax

TSL_SetLogMode(
           handle          lvarchar,
           log_type        integer,
           log_level       integer,
           logfile         lvarchar)
returns integer

TSL_SetLogMode(
           handle          lvarchar,
           log_type        integer,
           log_level       integer)
returns integer

TSL_SetLogMode(
           handle          lvarchar,
           log_level       integer)
returns integer
handle
The table and column name combination returned by the TSL_Attach function.
log_type (Optional)
The type of message log:

0 = No message log

1 = Log all messages to the specified file

2 = Log all messages in a queue for the loader program for retrieval by the TSL_GetFmtMessage or the TSL_GetLogMessage function.

3 = Default. Log all messages to the server message log

log_level
The severity of information that is included in the message log file:

1 = Informational messages, warning messages, and error messages.

2 = Warning messages and error messages.

4 = Default. Error messages.

logfile (Optional)
If the value of the log_type argument is set to 1, the path and file name of the loader message log file. If the log_type argument is set to a value other than 1, the logfile argument is ignored.

Usage

Use the TSL_SetLogMode function in a loader program to specify the severity of messages that are saved in the loader message log. You must run the TSL_SetLogMode function in the context of a loader session that was initialized by the TSL_Init function. The TSL_SetLogMode function changes the log mode that was specified by the TSL_Init function for all loading sessions.

Returns

  • 0 = The log mode was set.
  • An error if the function failed.

Examples

The following statement saves loader warning and error messages to a file:

EXECUTE FUNCTION TSL_SetLogMode('tsdata|raw_reads',1,2,'/tmp/messag.log');