question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

container.logs seems to no stream logs when the container is started without the tty option

See original GitHub issue

I’m not sure if it’s an issue.

I try to stream container logs using the docker-py client. I noticed I have no logs when my container is started without -t.

logs = container.logs(stream=True, follow=True, stdout=True, stderr=False, tail=0)

Even if I can show them using this command docker logs -f <container>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danqingcommented, Aug 27, 2017

Run into a similar problem. @TomasTomecek can you explain the difference between the two, and also what’s the difference between stream and follow? What happens if you specify one or both? Why does stream not follow? Does follow automatically stream? What is returned when both are specified?

0reactions
danqingcommented, Aug 29, 2017

Yeah the source is pretty confusing too 😦 I’ve hacked a solution, but it looks like the logging part of this library still needs some significant improvements to work reliably.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker Logs not Readable - Stack Overflow
That output is from an application that expects to write to a tty. This may be a configuration of the application that you...
Read more >
Your starter guide to Docker troubleshooting - TechTarget
Without the right tools, Docker troubleshooting can take a lot of time and effort. Read about how to use logs, helpful commands and ......
Read more >
docker container - Python on whales - GitHub Pages
Without stream , only a str will be returned, possibly much later in the future. With stream , you'll be able to read...
Read more >
Why Does My Docker Container Stop? - Tutorial Works
If there's no terminal attached, then your shell process will exit, and so the container will exit. You can stop this by adding...
Read more >
Forwarding Nginx Logs to Docker - Callback Insanity - Medium
It is fairly common practice in Docker to forward the logs from a container's main process (as defined by CMD or ENTRYPOINT instructions)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found