Missing log lines when writing to cloudwatch from ECS Docker containers

后端 未结 4 1058
暗喜
暗喜 2021-02-08 10:12

(Docker container on AWS-ECS exits before all the logs are printed to CloudWatch Logs) Why are some streams of a CloudWatch Logs Group incomplete (i.e., the Fargate Docker Conta

4条回答
  •  你的背包
    2021-02-08 10:14

    I had the same problem with flushing logs to CloudWatch.

    Following asavoy's answer I switched from exec form to shell form of the ENTRYPOINT and added a 10 sec sleep at the end.

    Before:

    ENTRYPOINT ["java","-jar","/app.jar"]
    

    After:

    ENTRYPOINT java -jar /app.jar; sleep 10
    

提交回复
热议问题