Turning traces on and off in servers processes using scripting
Procedure
- Start wsadmin
- Identify the object name for the TraceService MBean running in the process:
$AdminControl completeObjectName type=TraceService,node=mynode,process=server1,* AdminControl.completeObjectName('type=TraceService,node=mynode,process=server1,*')
- Obtain the name of the object and set it to a variable:
set ts [$AdminControl completeObjectName type=TraceService,process=server1,*] 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:
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=enabled AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=enabled')
- To turn tracing off, perform the following step:
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=disabled AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=disabled')
See Also
AdminControl object for scripted administration
Enabling tracing and logging
See Also
Commands for the AdminControl object