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

RFE: let logs command accept multiple containers #2219

Closed
TomasTomecek opened this issue Jan 26, 2019 · 10 comments
Closed

RFE: let logs command accept multiple containers #2219

TomasTomecek opened this issue Jan 26, 2019 · 10 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@TomasTomecek
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature

Description
I'm trying to migrate my projects from docker-compose to a podman-based solution. Probably the main blocker for me is that in docker-compose, you would get a stream of logs from all the containers. In podman, I can only pass a single container to podman logs.

Do you think this is a good idea?

I already checked out the code and I think it should be doable.

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 26, 2019
@baude
Copy link
Member

baude commented Jan 27, 2019

can you provide an example of what you'd be thinking? like would the containerid precede the log message?

@TomasTomecek
Copy link
Contributor Author

Yes, that's how docker-compose works. I would expect the same/similar functionality:

$ podman logs -f --tail 10 httpd mariadb app
httpd:   log message from httpd
httpd:   another log message from httpd
mariadb: hello
httpd:   httpd is doing something
mariadb: hello again
app:     I'm starting

@rhatdan
Copy link
Member

rhatdan commented Jan 28, 2019

I don't think this is a bad idea, we could even do --all. Please open a PR if you have something working?

@TomasTomecek
Copy link
Contributor Author

I'll try to take a look and figure it out.

@rhatdan
Copy link
Member

rhatdan commented Mar 8, 2019

@TomasTomecek Have you done anything on this?

@TomasTomecek
Copy link
Contributor Author

I haven't found free time to work on this. Sadly that will likely not change in coming weeks.

This issue is still on my mind, though.

@baude
Copy link
Member

baude commented Mar 8, 2019

@TomasTomecek what are the particulars around this? are you thinking of being able to add multiple container ids? what about --all ? one issue for me with all is that it might be too hard to be able to watch for containers that start, stop, rm, etc?

@TomasTomecek
Copy link
Contributor Author

are you thinking of being able to add multiple container ids?

yes

what about --all ?

I don't follow, logs command doesn't have such option now.

one issue for me with all is that it might be too hard to be able to watch for containers that start, stop, rm, etc?

Yes, that's correct. Therefore I'd do the initial implementation by only accepting started containers and if a container dies, just remove it from the watch list.

@baude baude self-assigned this Mar 11, 2019
@baude
Copy link
Member

baude commented Mar 11, 2019

i have a working version of this. let me clean it up and perhaps @TomasTomecek could give it a test?

baude added a commit to baude/podman that referenced this issue Mar 15, 2019
add the ability for users to specify more than one container at a time
while using podman logs.  If more than one container is being displayed,
podman will also prepend a shortened container id of the container on
the log line.

also, enabled the podman-remote logs command during the refactoring of
the above ability.

fixes issue containers#2219

Signed-off-by: baude <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Apr 13, 2019

This issue is resolved.

@rhatdan rhatdan closed this as completed Apr 13, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants