<p>I need to print the logs from my flask app in my Kubernetes pod.</p>

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

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

<p>Thank you</p>

userHG
<p>You can access stderr/stdout logs of containers which running in a pod.  </p>

<p>Therefore its actually not related to kubernetes.  </p>

<p>check this. it might help. <a href="https://stackoverflow.com/questions/51318988/why-flask-logger-does-not-log-in-docker-when-using-uwsgi-in-front">Why Flask logger does not log in docker when using UWSGI in front?</a><br>
You might want to look here. <a href="https://flask.palletsprojects.com/en/1.0.x/logging/" rel="nofollow noreferrer">https://flask.palletsprojects.com/en/1.0.x/logging/</a></p>
