Trying to get console.log() calls into a GreenGrass v2 log file

0

I'm trying to get console.log() calls from my JavaScript lambda to show up in a log file in AWS GreenGrass version 2. Version 1 has a "Local logs configuration" option area, under "Groups" -> "Settings", but I haven't been able to find any comparable settings for version 2. I see various log files in /greengrass/v2/logs, but none of them show my console.log() calls. My lambda is named ggOpcLee, and I see an empty ggOpcLee-component.log file, and a ggOpcLee.log file which has entries, but none from my log() calls. I upgraded to 2.1.0 to see if that would fix the problem, but still no logs. I have the aws.greengrass.LogManager component deployed. I see CloudTrail and CloudWatch logs for my lambda, but the log() calls do not seem to appear there.

Any thoughts appreciated...

gefragt vor 3 Jahren235 Aufrufe
2 Antworten
0

I found AWS "IoT > Settings > Logs" and set "Log Role" to "leeIotRole2" and "Log level" to "Debug", after creating a role "leeIotRole2" to allow IoT as described here https://docs.aws.amazon.com/iot/latest/developerguide/iot-create-role.html , but still no logging.

beantwortet vor 3 Jahren
0

My GreenGrass lambda was not getting called, I added console.log() call that always happens, and I uninstalled and reinstalled Greengrass, and now I see log messages.

Uninstall: https://docs.aws.amazon.com/greengrass/v2/developerguide/uninstall-greengrass-core-v2.html
Install: https://docs.aws.amazon.com/greengrass/v2/developerguide/install-greengrass-core-v2.html

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen