Change Kubernetes pods logging

2/19/2018

I Have an AKS (Azure Container Service) configured, up and running, with kubernetes installed.

Deploying containers on using [kubectl proxy] and the GUI of Kubernetes provided.

I am trying to increase the log level of the pods in order to get more information for better debugging.

I read a lot about kubectl config set

and the log level --v=0 [0-10]

but not being able to change the log level. it seems the documentation

can someone point me out in the right direction?

-- Johnny Zghaib
azure
debugging
kubernetes
logging

1 Answer

11/18/2019

The --v flag is an argument to kubectl and specifies the verbosity of the kubectl output. It has nothing to do with the log levels of the application running inside your Pods.

To get the logs from your Pods, you can run kubectl logs <pod>, or read /var/log/pods/<namespace>_<pod_name>_<pod_id>/<container_name>/ on the Kubernetes node.

To increase the log level of your application, your application has to support it. And like @Jose Armesto said above, this is usually configured using an environment variable.

-- d4nyll
Source: StackOverflow