Hi guys, can someone tell me how to get all the logs of a flow run if i give the flow run ID or better, when i am running the flow get it then only. I want to redirect it to a file. Kindly give a code snippet.
s
Samuel Hinton
01/27/2025, 12:41 AM
Something like:
Copy code
from prefect import get_client
from prefect.client.schemas.filters import (
LogFilter,
LogFilterFlowRunId,
)
async with get_client() as client:
log_filter = LogFilter(flow_run_id=LogFilterFlowRunId(any_=[flow_run_id]))
logs = await client.read_logs(log_filter)
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.