How to check my API logs inside my kubernetes cluster in GCP

2/22/2018

I'm trying to check the logs of my API but I cannot find them in Google Cloud Platform.

I explored Stackdriver but I only found the logs that kubernetes throws. I want to go deeper and check the logs that my API throws inside each pod.

Do I need to use another tool?

-- Arturo Aviles
google-kubernetes-engine
logging

2 Answers

2/23/2018

You can write logs to the pod logs in several ways. Have a look at Kubernetes logging , choose whichever you like most, and implement it into your API. Then you will find your logs via: kubectl logs

-- Thomas
Source: StackOverflow

3/12/2019

You can see the kube-apiserver.log in your Master node.

/var/log/kube-apiserver.log - API Server, responsible for serving the API

More references: https://kubernetes.io/docs/tasks/debug-application-cluster/debug-cluster/#looking-at-logs

-- JunYoung Choe
Source: StackOverflow