Before you begin
The JRas framework described in this task and its sub-tasks is deprecated. However, you can achieve similar results using Java logging.Why and when to perform this task
In the integrated mode of operation, message and trace events are sent to WebSphere Application Server logs. This is the default mode of operation.Steps for this task
import com.ibm.ras.*; import com.ibm.websphere.ras.*;
private RASMessageLogger msgLogger = null; private RASTraceLogger trcLogger = null;
com.ibm.websphere.ras.Manager mgr = com.ibm.websphere.ras.Manager.getManager(); msgLogger = mgr.createRASMessageLogger("Acme", "WidgetCounter", "RasTest", myTestBean.class.getName()); // Configure the message logger to use the message file created // for this application. msgLogger.setMessageFile("acme.widgets.DefaultMessages"); trcLogger = mgr.createRASTraceLogger("Acme", "Widgets", "RasTest", myTestBean.class.getName()); mgr.addLoggerToGroup(trcLogger, groupName);
Related concepts
Creating JRas manager and logger instances
Related tasks
Setting up for combined JRas operation
Setting up for stand-alone JRas operation