Log file not updated after manually writing into it

时间:2016-07-11 22:02:35

标签: ruby-on-rails logging amazon-ec2 puma amazon-cloudwatch

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?

0 个答案:

没有答案