How can I send logs to my amplify SSR (Nextjs) app to cloudWacth?

0

I am trying to send runtime logs to cloudWacth but I have not been successful, I am using the Hosting compute logs functionality

I have tried with console.log, console.info, among others and it doesn't work for me. Also with the UTILITIES Logger library from amplify and I haven't had any results either.

Can you help me, please. If there is something additional to do or how can I send the logs to cloudWacth.

Thanks greetings.

질문됨 일 년 전759회 조회
1개 답변
0

Are the required policies set for the IAM roles as described in this document?
https://docs.aws.amazon.com/amplify/latest/userguide/ssr-CloudWatch-logs.html

profile picture
전문가
답변함 일 년 전
  • Yes, the role has the following policies established: { "Sid": "PushLogs", "Effect": "Allow", "Action": [ "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "arn:aws:logs:us-east-1::log-group:/aws/amplify/:log-stream:" }, { "Sid": "CreateLogGroup", "Effect": "Allow", "Action": "logs:CreateLogGroup", "Resource": "arn:aws:logs:us-east-1::log-group:/aws/amplify/" }, { "Sid": "DescribeLogGroups", "Effect": "Allow", "Action": "logs:DescribeLogGroups", "Resource": "arn:aws:logs:us-east-1:***********:log-group:" }

    Additionally, I share with you what only the cloudwatch registers for me:

    [ { "@timestamp": "2023-06-22 21:11:39.740", "@message": "REPORT RequestId: 56ad9253-f559-4f59-ab59-0fddcf0a37b4\tDuration: 7.19 ms\tBilled Duration: 8 ms\tMemory Size: 1024 MB\tMax Memory Used: 213 MB\t\n" }, { "@timestamp": "2023-06-22 21:11:39.733", "@message": "START RequestId: 56ad9253-f559-4f59-ab59-0fddcf0a37b4 Version: $LATEST\n" } ]

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

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

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

관련 콘텐츠