https://prefect.io logo
#prefect-server
Title
# prefect-server
k

Kevin Weiler

07/14/2021, 9:17 PM
Hi there! I’m trying to set the
extra_loggers
config at the level of my flow (as described here) but it’s not having the desired effect (logging stuff from my imported code)
I’m on
0.15.1
this is my flow:
Copy code
from prefect import task, Flow
from prefect.executors import LocalDaskExecutor
from prefect.storage import Docker
from prefect.run_configs import LocalRun, DockerRun

from research.example_pkg import things

@task()
def run_thing1():
    if things.thing1():
        return True

@task()
def run_thing2():
    if things.thing2():
        return True

if __name__ == "__main__":
    with Flow("test_flow", executor=LocalDaskExecutor(scheduler="processes")) as flow:
        if run_thing1():
            thing2_var = run_thing2()

    flow.run_config = LocalRun(
        env={
            "PREFECT__LOGGING__LEVEL": "DEBUG",
            "PREFECT__LOGGING__EXTRA_LOGGERS": '["research"]'
        }
    )
    flow.run()
running that file doesn’t give me logged output from the imported “things”
but if I export
Copy code
PREFECT__LOGGING__EXTRA_LOGGERS='["research"]'
prior to running that flow file - it seems to work
is there anyway to set that logging config when creating the flow?
k

Kevin Kho

07/15/2021, 1:59 PM
Hi @Kevin Weiler, is this a custom module? I’m not sure this will help but could you try
"['research']"
instead? double quotes on the outside.
2 Views