Network Deployment (Distributed operating systems), v8.0 > Troubleshoot and support > Use HPEL to troubleshoot applications > Develop log and trace reading applications
Determining which of basic mode and HPEL mode is enabled
WAS offers both a HPEL log and trace framework, and a basic log and trace framework. There are a number of ways to determine which of the two frameworks is enabled.
In many circumstances it might be important to know whether the HPEL or basic log and trace framework is enabled, for example, when writing a script whose purpose is to read from any log files of the server.
Since the configuration files of a server can differ from the running state of a server (for example when configuration changes have been made but the server has not been restarted), steps are provided for determining the log and trace mode in various ways.
Procedure
- Use wsadmin to determine the log and trace mode that a running server uses.
- Start wsadmin. In this case, wsadmin must be connected to a running server, for example through the SOAP port. Read about starting the wsadmin scripting client for more information.
- Determine whether the HPELControlService object is available. If the HPELControlService is present it can be concluded that the server is running with the HPEL log and trace framework.
### Jython
HPELMBean = AdminControl.queryNames('cell=myCell,node=myNode, type=HPELControlService,process=myServer,*') if (HPELMBean == ''): print "HPEL is not enabled" else: print "HPEL is enabled"
AdminControl command description. The table lists AdminControl command and their description.
Command Description myNode The host name of the node myServer The name of the server
- Use wsadmin to determine the log and trace mode that a servers configuration specifies.
- Start wsadmin. In this case, wsadmin can be connected to a running server or accessing the configuration data for a stopped server. Read about starting the wsadmin scripting client for more information.
- Determine whether the RASLoggingService configuration object is enabled. If the RASLoggingService config object is enabled then it can be concluded that the server is configured to run with the basic log and trace framework. Otherwise, if the HighPerformanceExtensibleLogging config object is enabled it can be concluded that the server is configured to run with the HPEL log and trace framework.
If both the RASLoggingService config object and the HighPerformanceExtensibleLogging config object are enabled it can be concluded that the server is configured to run with the basic log and trace framework.
### Jython
RASLogging = AdminConfig.getid("/Cell:myCell/Node:myNode/Server:myServer/RASLoggingService:/") basicEnabled = AdminConfig.showAttribute(RASLogging, "enable") if (basicEnabled == "true"): print "Basic mode logging in effect" else: HPELSvc = AdminConfig.getid("/Cell:myCell/Node:myNode/Server:myServer/HighPerformanceExtensibleLogging:/") HpelEnabled = AdminConfig.showAttribute(HPELSvc, "enable") if (HpelEnabled == "true"): print "HPEL is enabled" else: print "No logging is enabled"
AdminControl command description. The table lists AdminControl command and their description.
Command Description myCell The name of the cell myNode The host name of the node myServer The name of the server
- Use the admin console to determine the log and trace mode that a running server uses.
- Log into the admin console.
- Click Troubleshooting > Logs and Trace > myServer (where myServer is the name of the server you are interested in)
- Find the Switch to HPEL Mode button. If this button is available, the server is using the basic log and trace framework. Otherwise, the server is using HPEL.
Results
For any method selected, the result is that you now know whether a server is configured to use the HPEL or basic mode log and trace framework.
Start the wsadmin scripting client