Skip to content
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

Json log format not working since v1.44.0 (ECS_LOG_OUTPUT_FORMAT) #2591

Closed
adebasi opened this issue Aug 27, 2020 · 5 comments
Closed

Json log format not working since v1.44.0 (ECS_LOG_OUTPUT_FORMAT) #2591

adebasi opened this issue Aug 27, 2020 · 5 comments

Comments

@adebasi
Copy link

adebasi commented Aug 27, 2020

Summary

The output format json, configured via ECS_LOG_OUTPUT_FORMAT, doesn't have any effect from version 1.44.0 on.

Description

In version 1.36.0 the output format json was introduced. Users were able to set the format to json by setting the env var ECS_LOG_OUTPUT_FORMAT. From 1.44.0 this seems to be broken and I was not able to find something related to this in the changelog.

I verified this behaviour by running containers with different versions:

$ docker run -e ECS_LOG_OUTPUT_FORMAT=json amazon/amazon-ecs-agent:v1.43.0
{"level": "info", "time": "2020-08-27T07:33:10Z", "msg": "Loading configuration", "module": "agent.go"}
$ docker run -e ECS_LOG_OUTPUT_FORMAT=json amazon/amazon-ecs-agent:v1.44.0
1598513604929243900 [Error] node must have children
1598513604932176700 [Info] Loading configuration

I noticed this error because I updated our agents to version 1.44.1 and setting ECS_LOG_OUTPUT_FORMAT to json had no effect.

Expected Behavior

Set ECS_LOG_OUTPUT_FORMAT to json has the effect that the container logs are in json format.

Observed Behavior

see description

@ubhattacharjya
Copy link
Contributor

ubhattacharjya commented Aug 27, 2020

Hi @adebasi ,

I am sorry to hear that you are facing this problem. I am investigating the issue from my end. I will update you with my findings.

Utsa

@ubhattacharjya
Copy link
Contributor

ubhattacharjya commented Aug 28, 2020

Hi @adebasi ,

I could reproduce the error that you faced.

Kindly use the following workaround:

docker run -e ECS_LOG_OUTPUT_FORMAT=json -e ECS_LOGFILE=/log/ecs-agent.log amazon/amazon-ecs-agent:v1.44.0

Let me know if you are still facing the issue

Utsa

@ubhattacharjya
Copy link
Contributor

The PR for fixing this issue : https://github.com/aws/amazon-ecs-agent/pull/2598/files

@adebasi
Copy link
Author

adebasi commented Aug 29, 2020

Hi @ubhattacharjya,
Thank you for the quick response and fixing the bug.

@ellenthsu
Copy link

This fix has been released as part of ECS Agent 1.44.4: https://github.com/aws/amazon-ecs-agent/releases/tag/1.44.4

Please perform an update of the Agent: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html or you can find the latest ECS Optimized AMIs containing ECS Agent 1.44.4 here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants