Closed keuhdall closed 1 year ago
Logging seems to work with my setup in https://github.com/armanbilge/sandbox/commit/cf909c5b73e832d45e78ddbf9567dfd90d99462f.
$ sam local invoke
Invoking MyLambda (java17)
Decompressing /workspace/sandbox/lambda.jar
Local image is up-to-date
Using local image: public.ecr.aws/lambda/java:17-rapid-x86_64.
Mounting /tmp/tmpssns_67h as /var/task:ro,delegated, inside runtime container
START RequestId: 852ef67f-b7e7-475c-bcda-3730d292f621 Version: $LATEST
trying to log something
trying to log something else
END RequestId: 852ef67f-b7e7-475c-bcda-3730d292f621
REPORT RequestId: 852ef67f-b7e7-475c-bcda-3730d292f621 Init Duration: 0.12 ms Duration: 797.27 ms Billed Duration: 798 msMemory Size: 128 MB Max Memory Used: 128 MB
{}
Turns out the issue was coming from Handler: hawk.Lambda::handler
, which should either be just the main class (Handler: hawk.Lambda
), or using handleRequest (Handler: hawk.Lambda::handleRequest
)
It seems that I can't get logs from my lambda built with Feral. I've been reproducing with this simple example (using Scala 3.3.0 and Feral 0.2.3):
When executing
sam local invoke LambdaFunction
I get:
The jar was build using
sbt assembly
and the following SAM template was used:On the other hand, this minimal Java example works fine:
When executing
sam local invoke HelloWorldLambdaFunction
I get:The jar was build using
mvn clean package
and the following SAM template was used: