https://prefect.io logo
Title
x

Xavier Babu

04/22/2022, 3:30 PM
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

Anna Geller

04/22/2022, 3:35 PM
there is an API call to read logs as described here but can you explain what you try to accomplish?
x

Xavier Babu

04/22/2022, 4:20 PM
I am not sure how to use the CreateLog and ReadLog APIs? Do you have any examples?
a

Anna Geller

04/22/2022, 5:44 PM
it's a REST API endpoint, you could even use curl. But can you explain what you try to accomplish?
x

Xavier Babu

04/22/2022, 5:46 PM
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

Anna Geller

04/22/2022, 5:58 PM
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

Xavier Babu

04/22/2022, 6:01 PM
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

Anna Geller

04/22/2022, 6:10 PM
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

Xavier Babu

04/22/2022, 6:12 PM
flow run logs.
BTW, thank you for your time Anna.
a

Anna Geller

04/22/2022, 6:19 PM
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
from prefect import get_run_logger
x

Xavier Babu

04/25/2022, 3:49 PM
Let me check. Thanks Anna.
👍 1