title: How to view container logs via stackdriver on GKE
body: <p>I've read that by default, clusters on GKE write all logs to stackdriver. On the GKE UI, I can see the container logs of all my deployments, but am looking to get these logs from an API programmatically.</p>
  
  <p>I've tried to do something like <code>gcloud logging read "resource.labels.pod_id="&lt;pod-id&gt;""</code> but nothing is returned.</p>
  
  <p>Do I need to do something special in order to enable logging on the cluster? And if not, how do I access logs for a specific deployment/pod/container? </p>
  
  <p>Further, are these logs persistent? As in, when the deployment dies, can I still access these logs?</p>