Hi! I’m looking a way to read a task logs when the...
# ask-community
g
Hi! I’m looking a way to read a task logs when the task finished, in the same flow run. I have this code
Copy code
with prefect.get_client() as c:
    logs = await c.read_logs(
        LogFilter(task_run_id={"any_": [task.id]}, level={"ge_": "info"})
    )
if I want info and errors how should I write the filter?
Copy code
LogFilter(task_run_id={"any_": [task.id]}, level={"ge_": "info"})
or
Copy code
LogFilter(task_run_id={"any_": [task.id]}, level={"le_": "info"})
and if task is the task variable assigned with
task = my_task.submit(…)
, how should I get the task id?