1

I use cloud watch logs to view my backend's output to console.log(). Recently some events have started not appearing (events where I am logging large objects). Is there any way for me to see what events cloud watch has rejected.

If I could see the event size too that would be very useful. I don't think my events are over 20kb a time (so I would be surprised if cloud watch was rejecting them as I read the max event size is 256kb).

Thank you

friartuck
  • 2,954
  • 4
  • 33
  • 67
  • Are you using `console.log(JSON.stringify(bigObject));` when logging? Also, keep in mind, CloudWatch tends to lag behind sometimes. – Ervin Szilagyi Nov 27 '21 at 12:47
  • yes i am using JSON.stringify. It's behind by about 10 days and some other things I'm logging are coming through. Very confused why I'm not seeing my logged objects – friartuck Nov 27 '21 at 13:18
  • That's not good, the lag should be at most a few minutes in my experience. The batch size for CloudWatch is `1MB` (event size is`256KB`, as you said), you should be able to log huge objects. I suspect the issue is somewhere else. I suggest checking the IAM policies CloudWatch. Or you may want to investigate if the CloudWatch agent is working correctly on your instance where the backend is deployed. – Ervin Szilagyi Nov 27 '21 at 13:22

0 Answers0