Hey there. We'd like to preserve all the prefect logs as files in a file system.
How can we get all prefect logs to be written to files as well? Thanks!
k
Kevin Kho
07/29/2021, 4:05 PM
Hey @Pedro Machado, check this code snippet for how to do it.
p
Pedro Machado
07/29/2021, 4:18 PM
Thanks, Kevin. Would I have to do this for every task? Is there a way to do it for the whole flow?
k
Kevin Kho
07/29/2021, 4:20 PM
You define the handler once, and I think it has to be attached to every task. I think attaching it to the Flow might work if you store your Flow as a script instead of pickle-based storage.