Setting up profile scripts to make tracing easier using wsadmin scripting

You can use scripting and the wsadmin tool to set up profile scripts to facilitate tracing.

Before you begin

Before starting this task, the wsadmin tool must be running. See wsadmin 스크립트를 사용하여 wsadmin 스크립트 클라이언트 시작 for more information.

Procedure

Set up a profile script to make tracing easier. The following profile script example turns tracing on and off for server1:
  • 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')
Note: The dumpThreads command creates other types of dump files depending on the -Xdumps settings. Dump output varies depending on the platform and might include system core files, heap, and snap dumps.

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 wsadmin 스크립트를 사용하여 wsadmin 스크립트 클라이언트 시작.


주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: July 9, 2016 6:14
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_profiletrace
파일 이름:txml_profiletrace.html