traceWrite()

Writes a trace message to the connector's trace destination.

Syntax

public final static void traceWrite(int traceLevel, String msg);
 

Parameters

traceLevel
Is one of the following trace levels:
                        JavaConnectorUtil.LEVEL1
 
  
                         JavaConnectorUtil.LEVEL2
 
  
                         JavaConnectorUtil.LEVEL3
 
  
                         JavaConnectorUtil.LEVEL4
 
  
                         JavaConnectorUtil.LEVEL5
 
 

The method writes the trace message when the current trace level is greater than or equal to traceLevel.

Note:
Do not specify a trace level of zero (LEVEL0) with a tracing message. A trace level of zero indicates that tracing is turned off. Therefore, any trace message associated with a traceLevel of LEVEL0 will never print.
msg
Is the message text to use for the trace message.

Return values

None.

Notes

You can use the traceWrite() method to write your own trace messages for a connector. Tracing is turned on for connectors when the TraceLevel connector configuration property is set to a nonzero value (any trace-level constant except LEVEL0).

The traceWrite() method sends the specified msg text to the trace destination when the current trace level is greater than or equal to traceLevel. You establish the name of a connector's trace destination through the Tracing section in the Trace/Log File tab of Connector Configurator.

Because trace messages are usually needed only during debugging, whether trace messages are contained in a message file is left at the discretion of the developer:

Connector messages logged with traceWrite() are not viewable using LogViewer.

See also

See the description of the generateMsg() method.

Copyright IBM Corp. 1997, 2004