Hello, been seeing some intermittent issues with l...
# ask-community
j
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
Are you using Prefect 1.0 or 2.0?
j
1.0…
k
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
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
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
@Darin Douglass curious, did you notice when this started to not work?
d
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
thanks, hopefully folks from prefect have insights…
a
Could you try setting this on your run config and if this doesn't work then setting this when starting your agent?
d
ours is set in the run config (we use the ECS runner, so it’s in the associated task definition’s
environment
vector)