I have a Rails application running under Puma which is configured to log to a file called puma.stdout.log
. I also have a Amazon Cloudwatch Logs agent that is monitoring this file so that I can access these logs for all my EC2 instances in the AWS Cloudwatch console.
When I write manually to this log file, it stops getting updated. When I open the log file, the last line is the line I added even though more logs should appear. Timestamps and file size don't change either.
The weird thing is: Cloudwatch is still getting updated with new logs from the agent monitoring this particular log file and the application runs just fine, so Puma keeps logging to this file but I can't see the changes.
When I restart Puma, I can see new logs into this log file and everything is back to normal.
Why can't I see this log file updated after writing manually to it?