Viewing logs

Cloud Code provides a structured view of the logging output that surfaces tasks, artifacts, and deployed resources. This view lets you see the status of each task in your deployment and locate more information in the full logging output. The Cloud Code Log Viewer provides tools for searching and filtering logs.

When you start a development, deployment, or debugging session, the Development sessions pane displays the structured logging view.

To open the Development sessions view, click Kubernetes Explorer icon Cloud Code - Kubernetes.

As a task begins, the task is displayed with a spinning semi-circle icon Progress icon.

If a task succeeds, a green checkmark Success icon is displayed next to the step.

If a task fails, a red exclamation mark Failure icon is displayed next to the step.

To see details of a step, click the step in the Development sessions pane. The Output pane displays the step in the logging output.

To view the full Skaffold logs, click the Status node.

Launching the Log Viewer

To launch the Log Viewer, open the Command Palette (press Ctrl/Cmd+Shift+P or click Manage icon Manage > Command Palette) and then type Cloud Code: View Logs.

Viewing logs for a specific resource

To view the logs for a specific resource, follow these steps:

  1. Open the Kubernetes Explorer or the Cloud Run Explorer by clicking Kubernetes Explorer icon Cloud Code - Kubernetes or Cloud Run explorer icon Cloud Code - Cloud Run.

  2. In the Kubernetes Explorer or the Cloud Run Explorer, right-click a resource and then and select View logs.

Viewing streaming logs

To have the Log Viewer display updated logs as the logs are generated, in the Log Viewer, turn the Streaming slider on.

Viewing Kubernetes logs using Cloud Logging

To display logs from GKE clusters with Cloud Logging enabled, follow these steps:

  1. To open the Log Viewer, open the Command Palette (press Ctrl/Cmd+Shift+P or click Manage icon Manage > Command Palette) and then type Cloud Code: View Logs.
  2. Select Kubernetes Application Logs from the Log Type list.
  3. To stream logs from multiple pods, turn on the Streaming slider and select all in the Pod list.
  4. Logs are displayed for the active cluster by default. To switch to a different cluster, select the cluster name from the Cluster list.

Log Viewer showing logs from a selected cluster

Viewing Kubernetes logs using kubectl

To display logs from a non-GKE cluster or a GKE cluster without Cloud Logging enabled, follow these steps:

  1. To open the Log Viewer, open the Command Palette (press Ctrl/Cmd+Shift+P or click Manage icon Manage > Command Palette) and then type Cloud Code: View Logs.
  2. Select Kubectl Logs from the Log Type list.
  3. In the Deployment or Pod list, select a deployment or pod to view logs from.

Viewing logs for a non-Cloud Logging cluster by setting the deployment
field within the Log Viewer search box to 'node-hello-world'

Viewing Cloud Run logs

To view logs from a Cloud Run service, follow these steps:

  1. To open the Log Viewer, open the Command Palette (press Ctrl/Cmd+Shift+P or click Manage icon Manage > Command Palette) and then type Cloud Code: View Logs.
  2. Select Cloud Run Logs from the Log Type list.
  3. Select a Cloud Run service from the Service list.
  4. To view the logs from a particular revision, select a revision using the Revision list.

Refining search results

You can refine your search results by clicking Search Logs and then typing search terms. This search includes the namespace, deployment, pod, container, and time. For clusters with Cloud Logging enabled, you can also filter by severity level.

Changing the display time

To change the display time to your preferred time zone, click More menu next to the Time column and then choose a time zone.

Getting Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.