<#4830 [Docs] Document logging inside Python tasks...
# flyte-github
c
#4830 [Docs] Document logging inside Python tasks running on a remote cluster Issue created by neverett ### Description Question from Slack:
Is 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 interface
Response: 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):
Copy code
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/flyte