View logs

This topic explains how to view log data on Stackdriver and using the kubectl logs command.

View logs on Stackdriver

This section explains how to view Apigee hybrid logs on Stackdriver and directly using kubectl.

If you are on GKE or Anthos GKE, logs are automatically sent to Stackdriver.

To view logs on Stackdriver:

  1. Go to Monitoring Logs Viewer.
  2. In the resource-type drop-down list, select GKE Container, the name of your cluster, and your namespace ID. For example:

    alt_text

    For more information, see Viewing logs in the GCP documentation.

The following example shows hybrid log output in the Log viewer:

alt_text

View log files directly

You can view the logs that are written to each pod's filesystem directly using kubectl, as follows:

kubectl logs pod_name -n namespace

For example:

kubectl logs apigee-mp-hybrid-docs-test-blue-6fb96f5b9-2k8hp -n my-namespace