Setting up for integrated JRas operation

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

  1. Import the requisite JRas extensions classes
    import com.ibm.ras.*; 
    import com.ibm.websphere.ras.*; 
  2. Declare logger references.
    private RASMessageLogger msgLogger = null; 
    private RASTraceLogger trcLogger = null; 
    
  3. Obtain a reference to the Manager and create the loggers.
    Since loggers are named singletons, you can do this in a variety of places. One logical candidate for enterprise beans is the ejbCreate() method. For example, for the enterprise bean named "myTestBean", place the following code in the ejbCreate() method.
    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



Searchable topic ID:   ttrb_jrasintegrate
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/ae/ttrb_jrasintegrate.html

Library | Support | Terms of Use | Feedback