Amazon ECS Log File in Fargate

0

I'm migrating from ecs with ec2 to ecs with fargate and have a question In case of ecs with ec2, we emit ECS log like ecs-agent.log, evs-init.log Are these also available in Fargate? If not, container insight is something similar to these?

質問済み 7ヶ月前281ビュー
2回答
0

As the underlying Platform Version (compute) is fully managed by Fargate, the ECS Agent is not available. Please see the following resources on ECS Fargate container logging options and Observability on ECS/Fargate

AWS
回答済み 7ヶ月前
profile pictureAWS
エキスパート
レビュー済み 7ヶ月前
0

ecs-agent.log and ecs-init.log are ECS Agent log files.

You don't need to care about them while using Fargate since it is a managed service.

Regarding the application log, you need to configure the logging driver inside of your task definition.

Also, need to send the application logs to the STDOUT/STDERR. Most of the container images are doing it by default. If you are creating your own image, make sure that the main process is not writing the logs in a file instead.

The logging configuration would be similar to this below:

{
    "containerDefinitions": [
                 (...)
                "logConfiguration": {
                        "logDriver": "awslogs",
                         "options": {
                                "awslogs-create-group": "true",
                                "awslogs-group": "awslogs-mysql",
                                 "awslogs-region": "us-west-2",
                                "awslogs-stream-prefix": "awslogs-example",
                                "mode": "non-blocking", 
                                "max-buffer-size": "25m" 
                }
            (...)

You can find more information about awslogs driver configuration on this documentation.

profile pictureAWS
回答済み 7ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ