Kathryn Klarich
09/23/2021, 8:29 PM*prefect.client.client.Client.write_run_logs*(logs)
- but i want to download, not upload the logsKevin Kho
query {
flow_run {
id
logs {
id
message
}
}
}
but for large logs, this can be slow and you might hit timeouts. There is also an API limit of 5 MB so I don’t think this is recommended.
It seems a bit repetitive because your process is writing logs to Prefect Cloud and then you are downloading it and then saving it elsewhere. Maybe you can write it to a FileHandler (which I have a snippet) for, and then use the state handler to upload that file to S3?
If you have some other logging service like Datadog, I think you would attach a StreamHandler to send those logs to both Prefect Cloud and that other serviceKevin Kho
Kathryn Klarich
09/23/2021, 8:49 PMKevin Kho