I have an application which uses nginx which is deployed as a docker container in aws ecs. nginx runs as a different user 'iris' ,same as my application. my application logs the errors and output to /home/iris/var/log/nginx/access.log, error.log. Now i need to redirect the logs to /dev/stdout and /dev/stderr so that cloudwatch can stream those log files. I tried
RUN ln -sf /dev/stdout /home/iris/var/log/nginx/access.log \
&& ln -sf /dev/stderr /home/iris/var/log/nginx/error.log
in my image file, but stops producing output as i believe the terminal device /dev/stdout is owned by root without write permission for others. I also tried
usermod -a -G sudo iris
No luck. Any help would be appreciated.