Turning traces on and off in servers processes using scripting

 

Turning traces on and off in servers processes using scripting

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

Perform the following steps to turning traces on and off in server processes:

  1. 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,*')

  2. 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,*')

  3. 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')




Related concepts
AdminControl object for scripted administration
Enabling tracing and logging

Related reference
Commands for the AdminControl object