I'm running a CLI on an EC2 server (Amazon Linux image), which I let run indefinitely with the screen terminal multiplexer. My program queries an API continuously and logs the current state to stdout:
The CLI logs encounters error occasionally, and it logs them, but when I SSH back into the EC2 server and recover the screen session, I see the latest logs only.
How can I keep track of everything printed to stdout, so I can inspect them later? CloudWatch?