[ Web Proxy ]
URL:
Viewing: https://docs.cloud.google.com/code/docs/shell/view-logs [Back]  [Original]

View Kubernetes logs in Cloud Code for Cloud Shell  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

View Kubernetes logs in Cloud Code for Cloud Shell Stay organized with collections Save and categorize content based on your preferences.

This page describes how to view the streaming logs of your application and to check the status of resources from within Cloud Code.

The Development sessions view 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 Log Viewer provides tools for searching and filtering logs.

View the status of tasks and resources

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

Launch the Log Viewer

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

Stream logs from a pod

To stream logs from a pod:

  1. Click cloud-code-icon.svg [cloud-code-icon.svg] Cloud Code and then expand the Kubernetes section.
  2. Expand your minikube cluster and then expand Pods.
  3. Right-click a pod and then click Stream Logs.
  4. If there are multiple containers in the pod, select a container when prompted.

View logs from a pod

  1. Click cloud-code-icon.svg [cloud-code-icon.svg] Cloud Code and then expand the Kubernetes section.
  2. Expand your minikube cluster and then expand Pods.
  3. Right-click a pod and then click View Logs
  4. If there are multiple containers in the pod, select a container when prompted.

View logs for a specific resource

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

  1. Click cloud-code-icon.svg [cloud-code-icon.svg] Cloud Code and then expand the Kubernetes section.
  2. In the Kubernetes section, expand the following:

    • The cluster whose logs you want to view
    • Namespaces
    • The namespace whose logs you want to view
    • Deployments
  3. Right-click the deployment and select View logs.

View streaming logs

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

View 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 View > Command Palette) and then run 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.

View 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 View > Command Palette) and then run 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.
  4. To refine your search results, click Search Logs and then type 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.

Change the display time

To change the display time to a different time zone, click more_vertMore next to the Time column header and then choose a time zone.

What's next

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page