How can we read log of a task or flow/subflow usin...
# prefect-community
x
How can we read log of a task or flow/subflow using Orion REST APIs? Also, Do we need to do any specific configuration to achieve it via REST APIs?
a
there is an API call to read logs as described here but can you explain what you try to accomplish?
x
I am not sure how to use the CreateLog and ReadLog APIs? Do you have any examples?
a
it's a REST API endpoint, you could even use curl. But can you explain what you try to accomplish?
x
We would like to show the log of recently executed flow/task in our Web UI
I believe the log is stored in the orion.db (sqlite) and we can retrieve any time using REST APIs.
a
couldn't you grant access to your Prefect 2.0 UI directly? this is literally what Orion UI is for 😄 you would kind of rebuild it from scratch then
x
Understood 🙂. Some restrictions we put for users to access the UI. Also, I noticed the UI is not showing any log. Do I need to enable any more parameters?
a
hmm that's weird, the UI should show logs in each flow run page. Do you mean flow run logs or some sort of access logs/audit history?
x
flow run logs.
BTW, thank you for your time Anna.
a
Can you send a screenshot showing your flow run page with missing logs? Did you use the Prefect logger to log things in your flow? check this blog post
Copy code
from prefect import get_run_logger
x
Let me check. Thanks Anna.
👍 1