WAS v8.5 > Script the application serving environment (wsadmin) > Troubleshooting with scripting

Turning traces on and off in servers processes using scripting

We can use scripting to turn traces on or off in server processes.

Before starting this task, wsadmin must be running. See the starting the wsadmin scripting client information. Perform the following steps to turn traces on and off in server processes:

  1. Identify the object name for the TraceService MBean running in the process:

    • Jacl:

        $AdminControl completeObjectName type=TraceService,node=mynode,process=server1,*
    • Jython:

        AdminControl.completeObjectName('type=TraceService,node=mynode,process=server1,*')

  2. Obtain the name of the object and set it to a variable:

    • Jacl:

        set ts [$AdminControl completeObjectName type=TraceService,process=server1,*]
    • Jython:

        ts = AdminControl.completeObjectName('type=TraceService,process=server1,*')

  3. Turn tracing on or off for the server.

    • To turn tracing on, perform the following step:

      • Jacl:

          $AdminControl setAttribute $ts traceSpecification com.ibm.*=all=enabled
      • Jython:

          AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=enabled')

    • To turn tracing off, perform the following step:

      • Jacl:

          $AdminControl setAttribute $ts traceSpecification com.ibm.*=all=disabled
      • Jython:

          AdminControl.setAttribute(ts, 'traceSpecification', 'com.ibm.*=all=disabled')


Related


Enable trace on a running server
Configure traces using scripting
Tracing operations using wsadmin.sh
Use the wsadmin scripting AdminControl object for scripted administration
Work with trace
Start the wsadmin scripting client using wsadmin.sh


Reference:

Commands for the AdminControl object using wsadmin.sh


+

Search Tips   |   Advanced Search