Viewing the topology logs

You can see all topology and observer logs by using the oc logs command.

About this task

All observers are deployed in pods. You can identify logs either by their names or their labels.

To increase or decrease the log levels for a specific observer to help investigate issues, you first use the oc get deployments command to display a list of all deployments. Then, use the oc edit deployment command to change the logging levels to, in this example, 'debug'. A log level of 'debug' logs all request or response operations to provide detailed diagnostic data.

Viewing logs

  1. To list all pods and the labels that are applied to the pods, run the oc get pod --show-labels command.

    oc get pod --show-labels
    

    Sample output:

    deploy-test-ciscoaci-observer-8755fcc94-7cp7h      1/1       Running   0          2d        app=ciscoaci-observer,chart=ciscoaci-observer,heritage=Tiller,pod-template-hash=431197750,release=deploy
    deploy-test-file-observer-76c5869d8b-tm7xj         1/1       Running   0          2d        app=file-observer,chart=file-observer,heritage=Tiller,pod-template-hash=3271425846,release=deploy-test
    deploy-test-rest-observer-789cd8699d-zb8vx         1/1       Running   0          2d        app=rest-observer,chart=rest-observer,heritage=Tiller,pod-template-hash=3457842558,release=deploy-test
    deploy-test-vmvcenter-observer-675bd88f5c-8kgnk    1/1       Running   0          2d        app=vmvcenter-observer,chart=vmvcenter-observer,heritage=Tiller,pod-template-hash=2316844917,release=deploy-test
    
  2. Display the logs by using either the pod names or labels. When you run the oc logs command, you must also specify the project (namespace).

    1. View logs for a specific pod:

      oc logs asm-layout-88bd88bdb-htjfp --namespace=netcool
      
    2. View logs by using the label:

      oc logs -l app=layout --namespace=netcool
      

Changing log levels to debug

Run the following command to change the debug level to DEBUG:

oc exec -it deploy-test-file-observer-76c5869d8b -- /opt/ibm/netcool/asm/bin/log-level.pyc --level DEBUG

Sample system output

Configured logging level for com.ibm to DEBUG
Response code: 200