Launching the Log Viewer
Cloud Code comes with a Log Viewer to help you monitor your application.
To launch the Log Viewer, type Cloud Code: View Logs using the Command Palette (accessible with Ctrl/Cmd+Shift+P or through the 'Manage' menu marked with a gear icon ).
Tip: You can also quickly access logs by finding your resource within the Kubernetes Explorer under the Cloud Code view , right-clicking it, and selecting View logs to display your specified logs in the Log Viewer.
Viewing logs from clusters
Using Cloud Logging
If you have clusters with Cloud Logging enabled, you can find all the Kubernetes logs from these clusters by opening the Log Viewer and selecting Kubernetes Application Logs from the Log Type dropdown.
To switch to a different cluster, select the cluster name from the Cluster dropdown.
If you want to view Kubernetes logs from your current active cluster using kubectl, select Kubectl Logs from the dropdown. You'll need to select a deployment or pod to view logs from, using the deployment or pod dropdowns.
Using Cloud Run
If you want to view logs from a Cloud Run Service, select Cloud Run Logs from the Log Type dropdown. You'll need to select a Cloud Run Service from the Service dropdown to view the logs from.
If you'd like to get consistently updated logs, you can turn the 'Streaming' slider on.
Refining search results
You can perform basic text filtering on the results displayed within the Log Viewer by using the search box at the top of the page. This includes filtering by namespace, deployment, pod, container, and time. Additionally, for clusters with Cloud Logging, you can also filter by severity level.
Tip: You can change the display time to your preferred time zone by selecting the three-dotted menu icon next to the 'Time' column and choosing a time zone.