# Spaces runtime logging

**URL:** <https://discuss.huggingface.co/t/spaces-runtime-logging/139383>\
**Category:** Spaces\
**Created:** [February 6, 2025, 8:35pm UTC](https://discuss.huggingface.co/t/spaces-runtime-logging/139383 "2025-02-06T20:35:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejschwartz](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ejschwartz/32/16902_2.png) [@ejschwartz](https://discuss.huggingface.co/u/ejschwartz)\
**Post date:** [February 6, 2025, 8:35pm UTC](https://discuss.huggingface.co/t/spaces-runtime-logging/139383/1 "2025-02-06T20:35:17Z")

</div>

It seems like only stderr is logged in my space – I’m using gradio running in a Docker container. Is this expected? I can’t find it documented anywhere.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [February 7, 2025, 3:55am UTC](https://discuss.huggingface.co/t/spaces-runtime-logging/139383/2 "2025-02-07T03:55:59Z")

</div>

I think stdout is also output to the log in the Gradio space. (It will be displayed if you print it.)  
I wonder if this is a specification for the Docker space only, or if it depends on the Gradio startup options…  
I’ve never heard of any documentation on this.

> **[Deploying Gradio With Docker](https://www.gradio.app/main/guides/deploying-gradio-with-docker)**
>
> A Step-by-Step Gradio Tutorial

---

<div class="post-metadata">

**Author:** ![petebachant](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/petebachant/32/38918_2.png) [@petebachant](https://discuss.huggingface.co/u/petebachant)\
**Post date:** [February 7, 2025, 3:58am UTC](https://discuss.huggingface.co/t/spaces-runtime-logging/139383/3 "2025-02-07T03:58:31Z")

</div>

You might want to try adding `ENV PYTHONUNBUFFERED=1` to your Dockerfile.

---

<div class="post-metadata">

**Author:** ![ejschwartz](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ejschwartz/32/16902_2.png) [@ejschwartz](https://discuss.huggingface.co/u/ejschwartz)\
**Post date:** [February 7, 2025, 2:17pm UTC](https://discuss.huggingface.co/t/spaces-runtime-logging/139383/4 "2025-02-07T14:17:11Z")

</div>

That’s a great idea. I wondered if it is related to buffering. I’ll try this out later today.

---

<div class="post-metadata">

**Author:** ![ejschwartz](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ejschwartz/32/16902_2.png) [@ejschwartz](https://discuss.huggingface.co/u/ejschwartz)\
**Post date:** [February 8, 2025, 3:49am UTC](https://discuss.huggingface.co/t/spaces-runtime-logging/139383/5 "2025-02-08T03:49:42Z")

</div>

It worked! I also made a PR with this change to [sayakpaul/demo-docker-gradio · Disable python buffering](https://huggingface.co/spaces/sayakpaul/demo-docker-gradio/discussions/3)
