You can use scripting to turn traces on or off in server processes.
Before you begin
Before starting this task, the wsadmin tool must be running. See the starting
the wsadmin scripting client information.
About this task
Perform the following steps to turn traces on and off in server
processes:
Procedure
- Identify the object name for the TraceService MBean running in
the process:
Using Jacl:
$AdminControl completeObjectName type=TraceService,node=mynode,process=server1,*
Using Jython:
AdminControl.completeObjectName('type=TraceService,node=mynode,process=server1,*')
- Obtain the name of the object and set it to a variable:
Using Jacl:
set ts [$AdminControl completeObjectName type=TraceService,process=server1,*]
Using Jython:
ts = AdminControl.completeObjectName('type=TraceService,process=server1,*')
- Turn tracing on or off for the server. For example:
- To turn tracing on, perform the following step:
Using Jacl:
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=enabled
Using Jython:
AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=enabled')
- To turn tracing off, perform the following step:
Using Jacl:
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=disabled
Using Jython:
AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=disabled')