Streamlit + Docker + Logging + View Logs

I assume I’m not the only one who had a problem with this.

Q: I needed to run streamlit via docker, save the logs of the output, and view the logs.

I’ve created a small demo of how to use Streamlit with docker and make it save logs and show them in the gui.

This does not show logs in real time, but I’ve made a simple demo of how to make the logs show in real-time, you may find the link in the repo.

Best regards.

4 Likes

BTW you can just add these two lines to your dockerfile and it will print in the console

ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8
1 Like