CORBA 2.3.3 Programmer's Guide for Java
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,
"Error writing to CustDB");
...
}
How the Error Logging Facility Works
The public API section of the error logging facility is based on the severity levels of the messages you log: Critical,
Error, Warning, or Informational. These severity levels are reflected in the methods defined in the
com.tandem.nsdom.Config.Config_Log class, as shown in the following code.
//com.tandem.nsdom.Config.Config_Log Class
public class Config_Log