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

Agent 1.44.0 replaces the functionality of environment variable ECS_LOGLEVEL with ECS_LOGLEVEL_ON_INSTANCE #2594

Closed
ubhattacharjya opened this issue Aug 28, 2020 · 2 comments

Comments

@ubhattacharjya
Copy link
Contributor

ubhattacharjya commented Aug 28, 2020

Summary

ECS agent version 1.44.0 replaces the functionality of environment variable ECS_LOGLEVEL with ECS_LOGLEVEL_ON_INSTANCE.

Description

You can see the same behaviour by setting ECS_LOGLEVEL_ON_INSTANCE any one of none | crit | error | warn | info | debug.
This issue might cause people who have ECS_LOGLEVEL set in their ecs.config file, to not have the effect as before.

If you are using "ECS_LOGLEVEL", you will be able to see agent logs in a log driver mentioned by the environment variables "ECS_LOG_DRIVER" and "ECS_LOG_OPTS".

For example,
If you are mentioning "ECS_LOGLEVEL" and you dont set "ECS_LOG_DRIVER" and "ECS_LOG_OPTS", jsonfile will be selected by default. You can see agent logs in json format by running "docker logs ecs-agent".

You can also use cloudwatch log driver to view agent logs by creating cloudwatch log group and setting the below accordingly.
ECS_LOG_DRIVER=awslogs
ECS_LOG_OPTS={"awslogs-region":"us-west-2","awslogs-group":"testLogGroup"}
ECS_LOGLEVEL=debug

There are other options to set the "ECS_LOG_DRIVER" and "ECS_LOG_OPTS". Please check the Readme file for ecs-agent

Workaround:
Replace ECS_LOGLEVEL with ECS_LOGLEVEL_ON_INSTANCE and you will see the previous behaviour where the /var/log/ecs/ecs-agent.log display the debug level logs

Expected Behavior

The agent should not change the previous behaviour of ECS_LOGLEVEL.
ECS_LOGLEVEL should be the log level for both /var/log/ecs/ecs-agent.log and agent logs propagated to the mentioned log driver. However, if ECS_LOGLEVEL_ON_INSTANCE is mentioned, it will override the log level mentioned in ECS_LOGLEVEL, only on the instance.

Observed Behavior

Environment Details

Supporting Log Snippets

@mythri-garaga
Copy link
Contributor

#2597 fixes this

@ubhattacharjya
Copy link
Contributor Author

1.44.3 contains the fix for this issue

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

2 participants