aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.53k stars 417 forks source link

`copilot svc logs ` has multiple minute delay #5926

Open rynonl opened 2 months ago

rynonl commented 2 months ago

I am wanting to tail my AWS logs in my terminal, so I am using copilot svc logs. The logs eventually come, but at a 3-4+ minute delay. They show up in the AWS UI basically instantaneously.

Is this a known issue, or is there perhaps some configuration somewhere I should be looking at to eliminate this delay using the CLI?

iamhopaul123 commented 2 months ago

hello @rynonl. It's probably because you have too many log streams (each task create its own and they won't get deleted with a task's stop). You can run svc status to get running tasks and do the log again and filter by specific running task copilot svc logs --tasks xxx.

Alternatively you can use cloudwatch logs insight which i believe would be much nicer to use for some major use cases

rynonl commented 2 months ago

Hmm, I'm only showing 1 running task so I think it's probably not that?

Service: web
Task Summary

  Running   ██████████  1/1 desired tasks are running
  Health    ██████████  1/1 passes HTTP health checks
            ██████████  1/1 passes container health checks

Tasks

  ID        Status      Revision    Started At      Cont. Health  HTTP Health
  --        ------      --------    ----------      ------------  -----------
  59a426f8  RUNNING     452         23 minutes ago  HEALTHY       HEALTHY