Logging using Stackdriver API on Kubernetes / Google Container Engine (GKE)

后端 未结 1 1078
一个人的身影
一个人的身影 2021-01-26 16:22

I have a go application that leverages Google Cloud Logging API.

The relevant code is the same as this sample from their documentation: https://github.com/GoogleCloudPla

1条回答
  •  一生所求
    2021-01-26 16:48

    So turns out the log were there but not where I'd expect them.

    Using the gcloud CLI I could see those logs got the resource type gce_instance and therefore appears in the GCE VM Instance category

    To figure this out:

      $ gcloud beta logging logs list
      projects//logs/
      ...
    

    then

    $ gcloud beta logging read projects//logs/
    ---
    insertId: ...
    jsonPayload:
       ...
    logName: ...
    receiveTimestamp: ...
    resource:
      labels:
        instance_id: ...
        project_id: ...
        zone: ...
      type: gce_instance
    timestamp: ...
    

    Note type being gce_instance

    0 讨论(0)
提交回复
热议问题