copilot-cli
copilot-cli copied to clipboard
Add ability to select container for logs command
At the moment, copilot svc logs
command only streams logs from the main application container. If there are any sidecars, its now showing those logs. Feature proposal is to do something like copilot svc logs -n web -e preprod -c $sidecarName
to show logs of $sidecarName container when needed.
@Fodoj Thank you for your request. This feature makes sense to me.
Hello @Fodoj !
From what I see now, copilot svc logs
should show the logs from both the main container as well as the sidecars. For example
Found only one deployed service web in environment test
copilot/mysidecar/1111111 This is from a sidecar
copilot/mysidecar/2222222 This is from a sidecar
copilot/web/1111111 2022/08/12 20:20:16 Get Succeeded
copilot/web/2222222 2022/08/12 20:20:16 Get Succeeded
where mysidecars
is the sidecar container's name, and web
is the service.
Is this consistent with what you are seeing right now?
It does indeed show logs from all containers, which can be a bit noisy if primary container logs a lot, and sidecar logs way less - and I want to see only sidecar logs to investigate some issue there :)
Sounds good! Yes just wanted to clarify 👍🏼. For example, running copilot svc logs -n web -e test --container mysidecar
should show the logs from the mysidecar
only.
This feature is now released in v1.22 🚀 !
For the blog post: https://aws.github.io/copilot-cli/blogs/release-v122/ Release notes: https://github.com/aws/copilot-cli/releases/tag/v1.22.0