project-flogo / aws-contrib

Project Flogo Activities and Triggers for AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lambda Trigger - Log Activity not wokring

akpuvvada opened this issue · comments

I have added logger activities in the my flow.
When I run it after creating Lambda function, I am not seeing any entries in logs related to these log activities.

Below is one of the log activity definition in code:

{
            "id": "log_2",
            "name": "Log_Request",
            "description": "Logs a message",
            "activity": {
              "ref": "#log",
              "input": {
                "addDetails": true,
                "message": "=string.concat('{\"zipC\": \"', $flow.CityCode_Input.zipcode, '\"}')"
              }
            }
          }

Below are the logs from AWS:

2019/11/28 03:43:35 Starting AWS Lambda Trigger..
START RequestId: 2a3efb5c-7f7c-4b99-8a73-175ab2185568 Version: $LATEST
2019/11/28 03:43:35 Received request: 2a3efb5c-7f7c-4b99-8a73-175ab2185568
2019/11/28 03:43:35 Payload Type: unknown
2019/11/28 03:43:35 Payload: 'map[zipcode:07604]'
END RequestId: 2a3efb5c-7f7c-4b99-8a73-175ab2185568
REPORT RequestId: 2a3efb5c-7f7c-4b99-8a73-175ab2185568	Duration: 202.13 ms	Billed Duration: 300 ms	Memory Size: 512 MB	Max Memory Used: 32 MB	Init Duration: 6.79 ms	

Please help!

The logger currently being used is bugged with lambda. You can update the log activity and change the json to.

{
....
"input": {
                "addDetails": true,
                "message": "=string.concat('{\"zipC\": \"', $flow.CityCode_Input.zipcode, '\"}')"
                 "usePrint": true
              },
....
}

Sampi, tried that and still not working.

        "tasks": [
          {
            "id": "log_2",
            "name": "Log_Request",
            "description": "Logs a message",
            "activity": {
              "ref": "#log",
              "input": {
                "addDetails": true,
                "message": "=string.concat('{\"zipC\": \"', $flow.CityCode_Input.zipcode, '\"}')",
				"usePrint": true
              }
            }
          },

Did you run flogo update github.com/project-flogo/contrib/activity/log@master ?

no, let me try that.

Did that now and still not working.

image

Alright, I missed some things, Can you run that again?

Yes, it is working now.
Thanks Samip.