1

I deploy my web site in the AWS ECS container and use for it the php:7.4-apache image.

My web site writes all logs to application.log file, not to the /dev/stdout. I am looking for solution, how I can upload the application.log to AWS CloudWatch. Right now, my logDriver is the awslogs, which takes data from /dev/stdout only, but not from log file.

I searched for solution in the google, found many ideas with many ways, but found not one that is quite clear. So right now, temporary only, I am using this bad trick: to my entrypoint.sh I just added this line – “tail -f /var/www/html/application.log > /proc/1/fd/1 &”. Of course, this line finish my Dockerfile - "CMD ["entrypoint.sh"] This trick I found here.

I had read already this, this and this but found no one example, how I can implement reading to CloudWatch from log file.

So, does somebody know where I can find the proper examples and reliable descriptions how to do it? Thanks.

0 Answers0