Greg Wyne

04/29/2022, 5:38 PM
Hi there! Another question. We recently did an upgrade to our prefect instance, and post upgrade some logs are no longer getting pulled in from the running task. We use a very lightweight wrapper around the DbtShellTask: And we have the log_stdout=True variable set which according this this should let the stdout show up: I’ve ssh’d into the running task and verified that its emitting the stdout we are expecting, is there a step I should be looking at somewhere? Thank you!

Anna Geller

04/29/2022, 5:44 PM
Good question! By default, dbt logs are not emitted directly when you run this task. You would need to capture those via a separate task.
def print_dbt_output(output):
    logger = prefect.context.get("logger")
    for line in output:
for a full example, check this blog post and LMK if you still have some questions about that