Hi All... I am trying to pull detailed prefect log...
# ask-community
f
Hi All... I am trying to pull detailed prefect logs using the graphql, however i could not find the table/column name in graphql which holds the detailed logs. Any help would be really appreciated
m
Hey @Farooque Shaikh Could you elaborate on the types os logs you're looking for, are they related to flow_runs, task_runs, or something else?
f
both flow_run and task_Run, so we are running dbt tasks through Prefect and the logs that we get on UI do not fit in 1 page so we have to keep scrolling up and down to read the entire log, I wanted to see if same log info is stored in some backend view so that i can extract that and load into one of our warehouse tables for easily querying on errors
m
Brilliant, you can retrieve logs from the graphql endpoint, I just run these in the interactive api but you should be able to query using the client as well 🙂
Copy code
query {
  flow_run {
    logs {
      message
      timestamp
    }
  }
}
f
i tried this, but the message and timestamp in logs is showing null for all records
@Mason Menges
m
depending on when the flow run was triggered some of the logs may be archived, it's also possible that could be a permissions issue, though unlikely.
f
is there anything i can check to figure out if this is access issue
m
Are you a user or an admin within the Tenant?
f
admin