Greengrass v2 logging


I am unable to see anything that I may log out of a Greengrass v2 component.

For example:

import logging
logger = logging.getLogger()

..."Hello world")

This will not be visible in my <COMPONENT>.log or greengrass.log files. I've tried different logging levels too.

asked 10 months ago98 views
1 Answer

You need to set a handler or set basic config. If you direct the logs to stdout, they will appear in the component log.

# or
logging.basicConfig(stream=sys.stdout, level=logging.INFO)

Or you could send them to a different file by using a FileHandler instead of a StreamHandler.

profile picture
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions