Hey, I'm noticing that none of the logs we produce...
# ask-the-community
r
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
Log level
r
Thanks @Ketan (kumare3) - Is this set during serialization, or as part of the decorators? (or elsewhere)
k
Cc @Yee
y
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
We're using the normal
logging
environment, and info level logs appear to be suppressed
y
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
"that" == the env var?
y
no “that” == the issue of logging not coming up
but also yes, setting that won’t affect anything.
r
Hmm alright...are there any other things I should try taking a look at?
y
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
I think so -- will read through that discussion first
103 Views