Configure traces using scripting

 

Procedure

  1. Start wsadmin

  2. 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)
    

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

  4. 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']])
      

  5. 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}}
      $AdminConfig save
      

    • Jython

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

  6. In a network deployment environment only, synchronize the node.


 

See Also


AdminControl object for scripted administration

 

See Also


Commands for the AdminControl object