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

JK

06/30/2022, 3:01 PM
Hello, been seeing some intermittent issues with logs — haven’t found repro steps yet, but the symptoms include: (a) only seeing error/warning despite root/prefect loggers are set to debug, and (b) some missing logs once in a while. Curious if anyone has seen this?
1
k

Khuyen Tran

06/30/2022, 3:01 PM
Are you using Prefect 1.0 or 2.0?
j

JK

06/30/2022, 3:02 PM
1.0…
k

Khuyen Tran

06/30/2022, 3:06 PM
I assume you did something like this?
Copy code
logger = prefect.context.get("logger")
logger.setLevel('DEBUG')

@task
def my_task():

    logger.debug("A debug message.")
And the debug or info logs don’t show up?
j

JK

06/30/2022, 4:41 PM
On your example above, if we have a lot of shared libs, is there a way to redirect the
root_logger
to
prefect.context.get("logger")
? So that we can just have
logging.error(xxx)
everywhere — instead of the extra call
prefect.context.get("logger")
?
🙌 1
Also, which pod should
PREFECT__LOGGING__LEVEL
be set in? The job? Dask Scheduler? Dask Worker?
d

Darin Douglass

06/30/2022, 8:15 PM
we’ve been seeing
PREFECT___LOGGING__LEVEL_
not being honored in our flows, so i’m interested to know if there’s a good resolution
j

JK

06/30/2022, 8:39 PM
@Darin Douglass curious, did you notice when this started to not work?
d

Darin Douglass

06/30/2022, 8:40 PM
not really a specific date. we’ve been pretty happy just sitting on INFO for a while. recently we wanted to swap to DEBUG to, ya know, debug stuff and we noticed it not actually working
at least the last couple days
j

JK

06/30/2022, 8:42 PM
thanks, hopefully folks from prefect have insights…
a

Anna Geller

07/01/2022, 1:20 AM
Could you try setting this on your run config and if this doesn't work then setting this when starting your agent?
d

Darin Douglass

07/01/2022, 2:43 PM
ours is set in the run config (we use the ECS runner, so it’s in the associated task definition’s
environment
vector)