CORBA 2.6.1 Programmer's Guide for Java
/* Set component ID */
set_component_name(java.lang.String pp_comp_name)
/* Set log file name */
set_log_file_name(java.lang.String pp_file_name)
Component Names
Each NonStop CORBA component should be assigned a unique component name so NonStop CORBA can identify the process that is logging
the error message. Component names are assigned once for each process, which must be done before an error message can be logged. If you
do not set the component name, the error logging facility assigns the default value
Application as the component name.
NonStop CORBA provides the following method to perform component ID initialization:
set_component_name (ComponentName);
When using this method, you supply your own ComponentName. The default name is Application. The predefined names listed below are used
by the NonStop CORBA components:
AdminServer
BSD
CommServer
EnvironServer
LSD
ILSD
InterfaceRepository
EventService
NameService
ConfigManagement
OTS
JTS
Message Logging Methods
Several com.tandem.nsdom.Config.Config_Log methods support setting component names and the logging of error messages. The following
methods offer support for logging Critical, Error, Warning, and Informational messages, as well as setting the component name and the log
filename:
Config_Log.log_critical()
Config_Log.log_error()
Config_Log.log_warning()
Config_Log.log_info()
Config_Log.set_component_name()
Config_Log.set_log_file_name()
Calling these methods causes the error logging facility to do the following:
Get the date, time, process name, process ID, and thread ID using system calls.
Compose a message using both user-supplied information and information gathered from the system.
Send an EMS message or record a message in the log file.
Error Numbers
Error numbers identify a problem that might occur in the NonStop CORBA environment. While NonStop CORBA reserves the error numbers
ranging from 0 through 6999, you can add user-defined error numbers in the numbers ranging from 7001 through 7100.
See the EMS Manual for details about error numbers.
Each error number is associated with the following information:
A symbolic name
A short description of the error
A list of actions that you can perform to resolve the problem
Error Logging Examples
The following code shows how to log an error using an error method. This example shows how to first set the component name using the
set_component_name() method. Then in an error-handling method, the code calls the log_error() predefined method to log a message that has
a severity level of error.
import com.tandem.nsdom.Config.Config_Log_Num;
void() {
// set the component name (done once per component)
Config_Log.set_component_name("Bank Server");
...
// log an error
Config_Log.log_error(Server.class, 1,Config_Log_Num.ZDOM_APP_MSGS,