Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to view logs #33

Open
devshawn opened this issue Jan 14, 2019 · 8 comments
Open

Add a way to view logs #33

devshawn opened this issue Jan 14, 2019 · 8 comments

Comments

@devshawn
Copy link

I'm using this project to create a CLI that wraps some docker-compose stuff to spin up a local environment. It would be nice to be able to have a command that would stream docker-compose logs.

Would this be possible, or is there an alternative you recommend?

@AlexZeitler
Copy link
Contributor

@devshawn Thanks for using docker-compose.
Would you like to implement this feature and send a PR or do you expect it to be available eventually?

@devshawn
Copy link
Author

I'd be happy to take a stab at it if no one has time for it. It'd be nice to have the option to view logs to the current point as well as streaming it. docker-compose logs vs docker-compose logs --follow.

The latter means the process wouldn't end until the user stops/kills it, but in my case, that's useful. What are your thoughts on this? It appears most commands here run in -d without any user interaction.

@AlexZeitler
Copy link
Contributor

Makes sense to me, get going 👍

@AlexZeitler
Copy link
Contributor

@devshawn is #38 what you're looking for?

@devshawn
Copy link
Author

devshawn commented Feb 5, 2019

@AlexZeitler - Yes, I believe this would work great! Sorry for not responding, I haven't had time for the project I'm using this for in the past couple of weeks. 👍

@AlexZeitler
Copy link
Contributor

@devshawn Great to hear! I've just released it on npm (v0.12.0).
Please let me know if it works for you.

@Steveb-p
Copy link
Contributor

Steveb-p commented Apr 17, 2019

@AlexZeitler I've read through the code and noticed that --follow flag will probably not work when one asks for a container that simply does not end. After all, promises are only resolved when process ends, which practically means there is no way to actually "follow" logs for a running process and - especially - multiple containers.

There is a possibility to handle following logs (or uping a container without actually detaching) if instead of working with a promise we would use JS generators and/or EventEmitters. This can potentially lead to reduction in memory usage, since there might no longer be need to store process output in a variable, but instead rely on user handling our event emission or reading directly from subprocess stdout/stderr (if yielded from generator at some point). This would constitute a major BC tho. WDYT?

btw, do you have any slack or gitter channel?

I've added #60 as work-in-progress / proof-of-concept.

@AlexZeitler
Copy link
Contributor

@Steveb-p I created a Slack workspace at https://pdmlab-oss.slack.com.

Just drop me a line with your email address at [email protected] so I can invite you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants