0

I need to print the logs from my flask app in my Kubernetes pod.

Actually my Flask app renders logs in a file.config file and I can access it with the command : kubectl exec -it podname /bin/bash and all the logs are not written in this file.

How can I do to have the logs (GET, error messages, print...) directly when I use the command : kubectl logs podname

Thank you

userHG
  • 567
  • 4
  • 29

1 Answers1

2

You can access stderr/stdout logs of containers which running in a pod.

Therefore its actually not related to kubernetes.

check this. it might help. Why Flask logger does not log in docker when using UWSGI in front?
You might want to look here. https://flask.palletsprojects.com/en/1.0.x/logging/

m303945
  • 883
  • 5
  • 9