CORBA 2.6.1 Programmer's Guide for C++

Server
Event
Service
NSDOM_CFG_TRACE_ES
NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_POA
NSDOM_CFG_TRACE_ES NSDOM_CFG_TRACE_POA NSDOM_CFG_TRACE_PROXY
NSDOM_CFG_TRACE_ORB NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_SOCKEH
es.log
ILSD
NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_POA
NSDOM_CFG_TRACE_POA NSDOM_CFG_TRACE_PROXY NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_SOCKEH
ilsd.log
IR
NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_POA
NSDOM_CFG_TRACE_POA NSDOM_CFG_TRACE_PROXY NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_GFSEH NSDOM_CFG_TRACE_GCFEH
ird.log
LSD
NSDOM_CFG_TRACE_ORB NSDOM_CFG_TRACE_ORB NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_SOCKEH lsd.log
Naming
Service
NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_POA
NSDOM_CFG_TRACE_POA NSDOM_CFG_TRACE_PROXY NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_GFSEH NSDOM_CFG_TRACE_GCFEH
ns.log
OTS
NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_POA
NSDOM_CFG_TRACE_OTS
NSDOM_CFG_TRACE_POA NSDOM_CFG_TRACE_PROXY NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_OTS NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_GFSEH
NSDOM_CFG_TRACE_GCFEH
ots.log
XID
Broker
NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_POA
NSDOM_CFG_TRACE_OTS
NSDOM_CFG_TRACE_POA NSDOM_CFG_TRACE_PROXY NSDOM_CFG_TRACE_ORB
NSDOM_CFG_TRACE_OTS NSDOM_CFG_TRACE_GIOP_FW NSDOM_CFG_TRACE_GFSEH
NSDOM_CFG_TRACE_GCFEH
ots.log
Calling the Trace Facility
To generate a trace message, you call the predefined trace macro or the log_trace() or trace() method defined in the NSDOM_Trace object. The
call must be complete with the required parameter values. The trace facility then creates a trace message and writes the message to an ASCII
trace file.
The trace file information and other configuration data used by the trace facility must be specified in the NonStop CORBA configuration before
the call (see
How to Enable Tracing).
Trace Macros
The macros shown below are provided to simplify the task of adding trace statements to your application code.
/* log trace message */
NSDOM_trace ( const char *pp_data,
short pp_data_len,
CORBA::Environment &pr_env );
/* printf style trace output */
NSDOM_tracef ( const char *pp_format, ...);
This macro opens the trace file and writes the trace message. If you use this macro, you do not need to make direct calls to the NSDOM_Trace
object.
Note:
To specifically close the trace file, you must call
NSDOM_Trace::close_trace_file(). If you do not call this method,
the trace facility closes the trace file when the current process exits.
Trace Settings for Application Processes
To enable tracing for an NonStop CORBA client or server process, set one or more environment variables prior to running the process. For a
client process, setting
NSDOM_CFG_TRACE_PROXY to TRUE is a useful starting point. If more detail is needed, enable one or more of the protocol
trace variables (depending on the protocols in use by the client). For a server process, setting
NSDOM_CFG_TRACE_POA to TRUE is a useful starting
point. If more detail is needed, enable
NSDOM_CFG_TRACE_ORB or enable one or more of the protocol trace variables (depending on the protocols in
use by the server).
Simple Tracing Example
The following example shows how to add a trace message to your code using the predefined trace macro. In the example, a message is written
to the default ASCII trace file.
#include <nsdorb/trace.h>
main()
{
CORBA::Environment lv_env;
char lv_trace_buf[100];
...
/*perform trace operation */
strcpy(lv_trace_buf, "User-routine while loop");
NSDOM_trace ( lv_trace_buf, strlen(lv_trace_buf ), lv_env);
...
/* using the printf-style trace macro */
NSDOM_tracef ("%s %d", S1, 25);
...
}
How the Trace Facility Interface Works
As a user of the Trace Facility, you need not know the actual API calls NSDOM_Trace. You should use the trace macros provided, and let them
do the work of calling the API methods. However, if you decide to use your own trace file you might find it useful to know how the Tracing