I created a simple Go Lambda to play with, using the Serverless framework. I expected (as per the documentation) that all output from fmt.Println
or log.Println
would show up in Cloudwatch. But I don't see it.
Here's an example of a line I put in purely for testing purposes:
func Handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
fmt.Println("Hello from lambda")
(...)
I'm certain the permissions are correct, because I see the log-group, and there are Cloudwatch entries to view for this lambda. I can actually see the log-group being created in CloudFormation, so I'm sure that's not the issue. But I just don't see the output from any Println
statements in CloudWatch. This is what I do see:
START RequestId: fd48461b-3ecd-11e8-9e32-594932db04f2 Version: $LATEST
END RequestId: fd48461b-3ecd-11e8-9e32-594932db04f2
REPORT RequestId: fd48461b-3ecd-11e8-9e32-594932db04f2 Duration: 13.82 ms Billed Duration: 100 ms Memory Size: 256 MB Max Memory Used: 21 MB
I've tried various other Print
methods (like Printf
), but you won't be surprised that didn't change anything.
What am I missing?