Mike O'Connor
03/19/2024, 10:10 AMMarvin
03/19/2024, 10:10 AMget_run_logger()
to log messages.
2. Use the flow's unique flow_run_id
to query logs through the API.
Unfortunately, the search did not return a direct answer or code example specifically for retrieving all logs from both flows and subflows through the Prefect API.
However, here's a conceptual approach:
- First, get the flow_run_id
of the parent flow, which should typically be available in the flow's context or from the state of the flow run.
- Then, query the Prefect API for all the logs associated with that flow_run_id
.
- If your subflows are separate flow runs, you would need to collect the flow_run_id
for each subflow run and repeat the log query for each subflow.
This process is not provided in the returned documents, so you may need to reference the Prefect API documentation or look for any relevant API endpoints that pertain to log retrieval.
If you need a detailed example or specific API methods to accomplish this task, please let me know so that I can assist you further.