https://prefect.io logo
#prefect-community
Title
# prefect-community
l

Lucien Fregosi

07/28/2022, 1:00 PM
Hello thanks for the hard work prefect 2.0 seems really promising 👏 I did manage to work a very simple hello world in a kubernetes job and have just a question, is that still possible to have the ouptut of a python function in the job run log ? From what i have seen i can’t see the ouptput (picture in thread)
r

Rob Freedy

07/28/2022, 1:18 PM
Hey Lucien!! When you say output, are you talking about logging the return value of a python function? In general, having a task do the work of your flow is good practice and will return more information about the work done in a task run. https://orion-docs.prefect.io/concepts/flows/#composing-flows
l

Lucien Fregosi

07/28/2022, 1:43 PM
oh great to know i didn’t use a task as my exemple was verrrryyyyy basic
r

redsquare

07/28/2022, 1:51 PM
@Lucien Fregosi Khuyen gave a great quick demo of this https://prefect-community.slack.com/archives/CL09KTZPX/p1656691165747079
👍 3
l

Lucien Fregosi

07/29/2022, 12:24 PM
hi @Rob Freedy I did use a task and watched the video but still doesn’t have any
print()
or
<http://logger.info|logger.info>()
displayed in the Prefect Flow run ui (but the
print
is displayed in the worker pod output)
r

Rob Freedy

07/29/2022, 5:29 PM
Hey Lucien! Are you seeing the flow runs in your Prefect Cloud account? If so, have you logged in to your prefect cloud account using the following command?
$ prefect cloud login --key xxx_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
https://orion-docs.prefect.io/ui/cloud-getting-started/#configure-execution-environment
l

Lucien Fregosi

08/01/2022, 11:52 AM
Hi @Rob Freedy i used prefect server deployed in a K8s cluster I see my flow run and I see the output of the job but nor
print
neither
<http://logging.info|logging.info>()
Ok just discovered
get_run_logger()
It works well with this function
3 Views