How does AWS App Runner decide which logs to persist to CloudWatch?

0

I searched the App runner config for the application but with no luck. I also read the docs here https://docs.aws.amazon.com/apprunner/latest/dg/monitor-cwl.html, but I can't seem to find the answer.

Our application has a mix of debug/info/error logs in this format:

{"level":"info","caller":"app/main.go:61","msg":"connecting to postgres database","version":""}

It seems that certain error logs of "level" : "error" are persisted to CloudWatch. However, not all of them are for some reason, and I don't know why.

For example I added this logline which triggers whenever any of our Handlers generate a 5xx

{"level":"error","caller":"api/routes.go:28","msg":"incoming request","version":"","uri":"/api/v1/users/profile","status":500,"method":"PUT","duration":"512ms","stacktrace":"<stacktrace>"}

But this never persists in CloudWatch for some reason

1개 답변
0
수락된 답변

Hello.

I think the AppRunner logs that are output to standard output (/dev/stdout) and error output (/dev/stderr) are output to CloudWatch Logs.
In other words, I don't know what kind of container you are running, but there may be logs that are not being output to standard output.
I think it's a good idea to run the container locally and check that the logs are output to standard output.

profile picture
전문가
답변함 2달 전
profile picture
전문가
검토됨 2달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠