1

I have a log file (example: apilog.txt) inside my docker container running in an EC2 instance.

I need to push the content in that file to AWS Cloudwatch log groups.

How can I achieve this task .

Thanks in Advance

Bala krishna
  • 111
  • 2

1 Answers1

0

Option 1 - Use ECS instead of EC2+docker. ECS is the same thing (EC2+docker) but better because it's integrated with other AWS services like CloudWatch and the container logs are automatically fed into CloudWatch Logs.

Option 2 - Use CloudWatch Logs logging agent in Docker

Option 3 - Use standalone CloudWatch Logs Agent that can read log files and feed them to CloudWatch.

Hope that helps :)

MLu
  • 23,798
  • 5
  • 54
  • 81
  • Hello MLu, I am actually using ECS only, I am pushing docker logs to Cloud watch but I need to push a file that is inside the container, not the container logs, – Bala krishna Jun 23 '20 at 15:28