Skip to content

Show logs for each container independently #1255

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/fix-compose-logs.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes the issue with compose logs for multiple targets when any container is missing
5 changes: 3 additions & 2 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -3553,9 +3553,10 @@ async def compose_logs(compose: PodmanCompose, args: argparse.Namespace) -> None
podman_args.append("-t")
if args.until:
podman_args.extend(["--until", args.until])
# podman logs supports multiple targets,
# but will fail completely if any container is missing
for target in targets:
podman_args.append(target)
await compose.podman.run([], "logs", podman_args)
await compose.podman.run([], "logs", [*podman_args, target])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work with -f, will it? I think better idea would be to check what containers exist and only pass existing ones to podman.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I forgot about -f



@cmd_run(podman_compose, "config", "displays the compose file")
Expand Down