Kevin Weiler

    1 year ago
    Hi there! I’m trying to set the
    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
    this is my flow:
    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
    def run_thing1():
        if things.thing1():
            return True
    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(
                "PREFECT__LOGGING__LEVEL": "DEBUG",
                "PREFECT__LOGGING__EXTRA_LOGGERS": '["research"]'
    running that file doesn’t give me logged output from the imported “things”
    but if I export
    prior to running that flow file - it seems to work
    is there anyway to set that logging config when creating the flow?
    Kevin Kho

    Kevin Kho

    1 year ago
    Hi @Kevin Weiler, is this a custom module? I’m not sure this will help but could you try
    instead? double quotes on the outside.