I have a github project which contains a Dockerfile that builds and launches two apps: react-app and node-server. My supervisord.conf
file specifies the stdout logfile directory for both of these:
[supervisord]
nodaemon=true
[program:nginx]
command=nginx -g 'daemon off;'
autostart=true
autorestart=true
stdout_logfile=/var/log/nginx.log
stderr_logfile=/var/log/nginx_err.log
[program:node-server]
command=node server.js
autostart=true
autorestart=true
stdout_logfile=/var/log/node_server.log
stderr_logfile=/var/log/node_server_err.log
[program:react-app]
command=npm start
directory=/app
autostart=true
autorestart=true
stdout_logfile=/var/log/react_app.log
stderr_logfile=/var/log/react_app_err.log
As you can see, lines like stdout_logfile=/var/log/react_app.log
write log output to react_app.log
.
When I build and run my Docker image locally and connect to the instance plus cd into /var/log/
and I can run commands like ls and cat to verify the log file is created and contains console.log
statements.
I want to view the contents of these log files online, using AWS. When I visit the AWS page located at Amazon Elastic Container Service / Clusters / MyClusterCoolName / Services / MyCoolClusterServiceName / Logs
I see logs, but these are only Dockerfile logs:
How can I make it so I can view the contents of my stdout_logfile online in AWS?