aws / amazon-ecs-agent

Amazon Elastic Container Service Agent
http://aws.amazon.com/ecs/
Apache License 2.0
2.08k stars 612 forks source link

ecs-agent logs to central loggin server #1969

Closed otonomoalon closed 5 years ago

otonomoalon commented 5 years ago

Hi,

Can we change the default log rotation policy of the agent logs to log only to a unique file name ( i.e. ecs-agent.log) and close it with date (i.e. ecs-agent.log.2019-03-31-07) and not log to a log file with the date in it (i.e. ecs-agent.log.2019-03-31-07)?

Using the same "live" log file will enable tail this log by a logging service and send it to a central logging server. (Any best practice to send ecs-agent logs to central logging server)?

Thank you,

haikuoliu commented 5 years ago

Hi @otonomoalon

To clarify, what do you mean by close it with date (i.e. ecs-agent.log.2019-03-31-07)? Do you want the agent to log all the logs to ecs-agent.log and make each log line end with something like ecs-agent.log.2019-03-31-07?

Thanks, Haikuo

otonomoalon commented 5 years ago

Hi @haikuoliu hanks for your replay. yes - the agent to log all the logs to ecs-agent.log and make each log line end with something like ecs-agent.log.2019-03-31-07 - this is the desired behaviour.

However - We understood that this is not configurable but should be "hard coded" in the project? Also any best practice on tailing the active log in real time and send it to central logging server?

Thanks, Alon

haikuoliu commented 5 years ago

@otonomoalon

Agent currently uses seelog, this is how our config looks like and this is doc for the rotation config. I hope it will help you understand our log rotation behaviors.

We understood that this is not configurable but should be "hard coded" in the project?

Yeah you are right it's not configurable now, to achieve that we may need to introduce another env var and some config for logger.

Also any best practice on tailing the active log in real time and send it to central logging server?

Sorry we don't have suggestions for it, it's all up to customers. I will mark this as a feature request.

otonomoalon commented 5 years ago

@haikuoliu Thank you very much fo r he help. We will go with live till by fluend and forward with fluent o remote.

Best,

Mohmohmoh2010 commented 5 years ago

abwlylaasamh@gmail.com

adnxn commented 5 years ago

wrt central logging for agent logs, we have some documentation around pushing agent logs to cloudwatch. closing this issue since we do not have plans to change the current default logging configuration.