WebSphere Application Server Version 6.1 Feature Pack for Web Services
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

             Personalize the table of contents and search results

Setting up for integrated JRas operation

Use JRas operations in integrated mode to send trace events and logging messages to only WebSphere Application Server logs.

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.

About this task

In the integrated mode of operation, message and trace events are sent to WebSphere Application Server logs. This approach is the default mode of operation.

Procedure

  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 class and create the loggers. Because loggers are named singletons, you can do this activity in a variety of places. One logical candidate for enterprise beans is the ejbCreate method. For example, for the myTestBean enterprise bean, 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 that is created 
    // for this application. 
    msgLogger.setMessageFile("acme.widgets.DefaultMessages"); 
    trcLogger = mgr.createRASTraceLogger("Acme", "Widgets", "RasTest", 
             myTestBean.class.getName()); 
    mgr.addLoggerToGroup(trcLogger, groupName); 
    



In this information ...


IBM Redbooks, demos, education, and more


Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

IBM Suggests
Task topic    

Terms of Use | Feedback

Last updated: Nov 25, 2008 2:35:59 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/ttrb_jrasintegrate.html