hi! I can't see stdout messages from a kubernetes ...
# ask-community
a
hi! I can't see stdout messages from a kubernetes job in prefect cloud, I have this on my jobs
Copy code
PREFECT__CLOUD__SEND_FLOW_RUN_LOGS=true
PREFECT__LOGGING__LOG_TO_CLOUD=true
I'm using
@task(log_stdout=True)
and I can see the message in kubernetes it self. I can see the message "hey budy" in the log as you can see here, but is not present in the cloud UI am I missing something?
k
Hey @Alvaro Durán Tovar, is this log coming from a custom library?
Or is it literally a
print()
inside a task?
a
just a raw print this is the code
Copy code
import prefect
from prefect import task, Flow
from prefect.run_configs import UniversalRun
from prefect.storage.gitlab import GitLab

@task(log_stdout=True)
def hello(name):
    <http://prefect.context.logger.info|prefect.context.logger.info>("hey?")
    print("hey", name)

with Flow("metaflow-run") as flow:
    hello("budy")

flow.storage = GitLab(
    repo="********",
    ref="test-metaflow",
    path="metaflow.py",
    host="http://********"
)

flow.run_config = UniversalRun(labels=["metaflow"])
not having success with prefect.context.logger also 😞
k
I can’t think of any reason. Does the same behavior happen on local agent?
a
@Alvaro Durán Tovar I was trying to reproduce using this Github flow and local Kubernetes cluster and didn’t see any issue with stdout. Can you try again using KubernetesRun?
a
same thing
this is the docker image btw prefecthq/prefect:0.15.10
k
Same thing on local too?
a
Actually yes, that's weird
executing locally do not send print to cloud
k
Will ask the team for ideas
a
omg 🤦 🤦 ** 1000
I didn't commited and pushed
all working now, sorry for bothering with this
a
thanks for sharing. Everything makes sense again 😄
k
Oh man glad you figured that out. lol