Streamlit app running inside Docker doesn't show logs
See original GitHub issueSummary
I can’t seem to manage to get logging working when running a streamlit app inside Docker. Neither logging calls nor prints are not shown on console or with docker logs
.
Steps to reproduce
-
Clone git@github.com:danimateos/streamlitdockerlog.git, cd into directory
-
Docker build
docker build -t strtest:latest .
- Docker run
docker run -p 80:8501 strtest:latest
-
Go to localhost on browser.
-
Watch docker logs:
docker logs [your_container_name]
Expected behavior:
Three lines appear in the docker logs each time the browser tab is reloaded because of the following code in app.py:
logging.info('info')
logging.error('error')
print('print')
Actual behavior:
Nothing appears with docker logs. When the app is run with streamlit run app.py
, the three lines do appear.
Is this a regression?
Not that I know.
Debug info
- Streamlit version: 0.58
- Python version: 3.8.2
- Using Conda? Yes, as described in the Dockerfile
- OS version: Ubuntu 20.04
- Browser version: Chrome version 81.0.4044.122 (Official Build) (64-bit)
Additional information
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Streamlit + Docker + Logging + View Logs
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,...
Read more >Error running streamlit docker
I've been trying to create an docker image to run fbprohet and streamlit. When i run the docker run command i get the...
Read more >Docker logging while running Streamlit
Hi, I've managed to get Streamlit to successfully run within a Docker container. My script prints out certain things when certain operations ...
Read more >Saving logs? - Using Streamlit
I have a similar, but slightly different problem. Running my app locally, I can download (from within the app) a log file containing...
Read more >Deploy Streamlit using Docker
You typically use a VPN to log onto your corporate network and access resources there. You could run your Streamlit app on a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you have
in your
Dockerfile
@danimateos ? You will need that. I don’t exactly understand why but I once spent a lot of time investigating why “kubernetes did not give me logs back” from a Python docker image 😃Maybe you need to add
Hi! Any news on this! I would really like to be able to keep track of how people are using my web app…