# Spaces runtime logging

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383%3E%5C
**Category:** Spaces\
**Created:** [February 6, 2025, 8:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fejschwartz)%5C
**Post date:** [February 6, 2025, 8:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [February 7, 2025, 3:55am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fpetebachant)%5C
**Post date:** [February 7, 2025, 3:58am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383%2F3 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fejschwartz)%5C
**Post date:** [February 7, 2025, 2:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383%2F4 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fejschwartz)%5C
**Post date:** [February 8, 2025, 3:49am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fspaces-runtime-logging%2F139383%2F5 "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)
