You can use scripting and the wsadmin tool to set up profile scripts to facilitate tracing.
Before starting this task, the wsadmin tool must be running. See Starting the wsadmin scripting client using wsadmin scripting for more information.
Using Jacl:
proc ton {} {
global AdminControl
set ts [$AdminControl queryNames type=TraceService,node=mynode,process=server1,*]
$AdminControl setAttribute $ts traceSpecification com.ibm.=all=enabled
}
proc toff {} {
global AdminControl
set ts [$AdminControl queryNames type=TraceService,node=mynode,process=server1,*]
$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=disabled
}
proc dt {} {
global AdminControl
set jvm [$AdminControl queryNames type=JVM,node=mynode,process=server1,*]
$AdminControl invoke $jvm dumpThreads
}
Using Jython:
def ton():
global lineSeparator
ts = AdminControl.queryNames('type=TraceService,node=mynode,process=server1,*')
AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.=all=enabled')
def toff():
global lineSeparator
ts = AdminControl.queryNames('type=TraceService,node=mynode,process=server1,*')
AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=disabled')
def dt():
global lineSeparator
jvm = AdminControl.queryNames('type=JVM,node=mynode,process=server1,*')
AdminControl.invoke(jvm, 'dumpThreads')
If you start the wsadmin tool with this profile script, you can use the ton command to turn on tracing in the server, the toff command to turn off tracing, and the dt command to dump the Java threads. For more information about running scripting commands in a profile script, see Starting the wsadmin scripting client using wsadmin scripting.