0

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

For example:

import logging
...
...
logger = logging.getLogger()
logger.setLevel(logging.INFO)

...
...
logger.info("Hello world")

This will not be visible in my .log or greengrass.log files. I've tried different logging levels too. and with logger.debug("...")

Sash
  • 1,134
  • 11
  • 23

2 Answers2

1

I ended up configuring my logging to:

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
Sash
  • 1,134
  • 11
  • 23
0

Are you running Python with the -u argument to disable output buffering? Without this argument, Python scripts might not output logs.

See this troubleshooting entry: Python script doesn't log messages