https://flyte.org logo
#ask-the-community
Title
# ask-the-community
r

Rahul Mehta

11/10/2022, 2:19 PM
Hey, I'm noticing that none of the logs we produce in our various tasks are actually surfaced when viewing pod logs (I only see the flytekit warnings about pickle types) -- is there something in particular we need to set to make logging work?
k

Ketan (kumare3)

11/10/2022, 3:53 PM
Log level
r

Rahul Mehta

11/10/2022, 3:54 PM
Thanks @Ketan (kumare3) - Is this set during serialization, or as part of the decorators? (or elsewhere)
k

Ketan (kumare3)

11/10/2022, 3:55 PM
Cc @Yee
y

Yee

11/10/2022, 5:22 PM
how are you doing logging rahul? we’re going to do some work cleaning up how logging works in flytekit next month.
the environment variable to set is
FLYTE_SDK_LOGGING_LEVEL=10
for debug
r

Rahul Mehta

11/10/2022, 5:23 PM
We're using the normal
logging
environment, and info level logs appear to be suppressed
y

Yee

11/10/2022, 5:26 PM
like just import logging?
so that won’t change then with our updates. you’ll need to update that manually
these are the current flytekit loggers, they were designed to be as out of the way as possible from the normal python logging constructs
r

Rahul Mehta

11/10/2022, 5:28 PM
"that" == the env var?
y

Yee

11/10/2022, 5:28 PM
no “that” == the issue of logging not coming up
but also yes, setting that won’t affect anything.
r

Rahul Mehta

11/10/2022, 5:29 PM
Hmm alright...are there any other things I should try taking a look at?
y

Yee

11/10/2022, 5:32 PM
you’ll need to call basicConfig I think
one sec
digging up something
yeah so flytekit doesn’t get completely out of the way… because any call to logging without a root handler will trigger a call to basicConfig - so you’ll need to call basicConfig with a force.
note that this is all python logging sematics, very little to do with flyte.
however we also attach the user logger created in that loggers.py file to the flytekit user context - so you can do
Copy code
flytekit.current_context().<http://logging.info|logging.info>(...)
for that to show though you’ll need to set that environment variable above.
does this make sense?
r

Rahul Mehta

11/10/2022, 6:14 PM
I think so -- will read through that discussion first
2 Views