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

后端 未结 1 1077
一个人的身影
一个人的身影 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/<PROJECT>/logs/<LOG_NAME>
      ...
    

    then

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

    Note type being gce_instance

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