cuddly-jelly-27016
05/25/2025, 12:11 AMIs there a convenient way of logging inside normal python tasks running on a remote cluster? Specifically just logging to stdout or somehow accessible on the Flyte web interfaceResponse: In order to do this, you need to use the flytekit logger and set the level to 20. To do this in ImageSpec (or add to Dockerfile):
ImageSpec(python_version="3.9.13",
packages=[flytekit_package, flytekitplugins_spark_package],
registry="localhost:30000",
apt_packages=["git","wget"],
env={"FLYTE_SDK_LOGGING_LEVEL": "20"},)
To log, import logger from flytekit and call in the task, making sure to set up the env variable:
https://github.com/flyteorg/flytekit/blob/f721eef474bb04ec2df581a690fb703e7c2b7956/flytekit/deck/deck.py#L6
https://github.com/flyteorg/flytekit/blob/f721eef474bb04ec2df581a690fb703e7c2b7956/flytekit/deck/deck.py#L149
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/25/2025, 12:11 AM