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

Configure traces using scripting

Use wsadmin and scripting to configure traces for a configured server.

Before starting this task, wsadmin must be running. See the starting the wsadmin scripting client information. Perform the following steps to set the trace for a configured server:

  1. Identify the server and assign it to the server variable:

    • Jacl:

        set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
    • Jython:

      server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
      print server

    Example output:

      server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)

  2. Identify the trace service belonging to the server and assign it to the tc variable:

    • Jacl:

        set tc [$AdminConfig list TraceService $server]
    • Jython:

      tc = AdminConfig.list('TraceService', server)
      print tc

    Example output:

      (cells/mycell/nodes/mynode/servers/server1|server.xml#TraceService_1)

  3. Set the trace string. The following example sets the trace string for a single component:

    • Jacl:

      $AdminConfig modify $tc {{startupTraceSpecification 
      com.ibm.websphere.management.*=all=enabled}}
    • Jython:

      AdminConfig.modify(tc, [['startupTraceSpecification',  
      'com.ibm.websphere.management.*=all=enabled']])

  4. The following command sets the trace string for multiple components:

    • Jacl:

      $AdminConfig modify $tc {{startupTraceSpecification 
      com.ibm.websphere.management.*=all=enabled:com.ibm.ws.
      management.*=all=enabled:com.ibm.ws.runtime.*=all=enabled}}
    • Jython:

      AdminConfig.modify(tc, [['startupTraceSpecification',  
      'com.ibm.websphere.management.*=all=enabled:com.ibm.ws.
      management.*=all=enabled:com.ibm.ws.runtime.*=all=enabled']])

  5. Save the configuration changes. See the saving configuration changes with wsadmin information.


Related


Enable trace on a running server
Turning traces on and off in servers processes using scripting
Tracing operations using wsadmin.sh
Use the wsadmin scripting AdminControl object for scripted administration
Start the wsadmin scripting client using wsadmin.sh
Save configuration changes with wsadmin


Reference:

Commands for the AdminControl object using wsadmin.sh


+

Search Tips   |   Advanced Search