'Docker Logs Push To Cloudwatch Logs

I'm using a ubuntu ec2 instance and i'm running docker on the ubuntu ec2 instance. now I've two docker containers one is nginx and other is redix. I've configured cloudwatch logs with redix and Nginx container i made using proxy Now if i connect Nginx with redix, i want these logs of connecting, which should be sent to cloudwatch logs. When i created the redix containers, it made the logs in cloudwatch logs. I'm also using a bridge connection between these two containers but can someone tell me how can i connect the two containers so that it creates logs. Here's my docker-compose file for redix container.

version: "3.7"
services:
  cuongquachlab-nginx:
    image: redis:latest
    restart: always
    ports:
    - "6379:80"
    logging:
      driver: "awslogs"
      options:
        awslogs-region: "us-east-1"
        awslogs-group: "/apps/cuongquachlab-nginx"
        awslogs-create-group: "true"


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source