Turning traces on and off in servers processes using scripting
You can use scripting to turn traces on or off in server processes. Before starting this task, the wsadmin tool must be running. See the Start the wsadmin scripting client article for more information.
Overview
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:
- Use Jacl:
$AdminControl completeObjectName type=TraceService,node=mynode,process=server1,*
- Use Jython:
AdminControl.completeObjectName('type=TraceService,node=mynode,process=server1,*')
- Obtain the name of the object and set it to a variable:
- Use Jacl:
set ts [$AdminControl completeObjectName type=TraceService,process=server1,*]
- Use 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:
- Use Jacl:
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=enabled
- Use Jython:
AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=enabled')
- To turn tracing off, perform the following step:
- Use Jacl:
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=disabled
- Use Jython:
AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=disabled')
Use the AdminControl object for scripted administration
Work with trace
Related Reference
Commands for the AdminControl object
Tracing and logging configuration