WebSphere® Application
Server offers both a High Performance Extensible Logging (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.
About this task
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.
Using Jython:
HPELMBean = AdminControl.queryNames('cell=myCell,node=myNode,
type=HPELControlService,process=myServer,*')
if (HPELMBean == ''):
print "HPEL is not enabled"
else:
print "HPEL is enabled"
Table 1. 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.
Supported configurations: 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.
Using 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"
Table 2. 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 administrative console to determine the log and trace mode that a running server
uses.
- Log
into the administrative console.
- Click (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.