You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Hello,
in our stack we used to work on go1.x runtime, but recently we switched to provided.al2 according to https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/ . After successful deploy we noticed shortage of logs in CloudWatch. It turns out that errors returned from handler are not visible in CW. I have run https://hub.docker.com/r/amazon/aws-lambda-provided and it seems like error message is not put on stdout/stderr as it was in go1.x.
Describe the solution you'd like
Probably one line with logging should be enough:
if functionResponse.Error != nil {
log.Printf("%v", functionResponse.Error) // <- NEW LINE
payload := safeMarshal(functionResponse.Error)
if err := invoke.failure(payload, contentTypeJSON); err != nil {
return fmt.Errorf("unexpected error occurred when sending the function error to the API: %v", err)
}
if functionResponse.Error.ShouldExit {
return fmt.Errorf("calling the handler function resulted in a panic, the process should exit")
}
return nil
}
I can create PR with the change.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Making this consistent for those migrating between the two makes sense to me. This means there needs to be some consideration to ensure that the logging happens only for the path using the runtime API, to prevent double-logging for existing go1.x users. Also, I think the format of the logging done by the go1.x may have some quirks that'll need to be tested against to ensure consistency.
Is your feature request related to a problem? Please describe.
Hello,
in our stack we used to work on
go1.x
runtime, but recently we switched toprovided.al2
according to https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/ . After successful deploy we noticed shortage of logs in CloudWatch. It turns out that errors returned from handler are not visible in CW. I have run https://hub.docker.com/r/amazon/aws-lambda-provided and it seems like error message is not put on stdout/stderr as it was ingo1.x
.Describe the solution you'd like
Probably one line with logging should be enough:
I can create PR with the change.
The text was updated successfully, but these errors were encountered: