Hey there. We'd like to preserve all the prefect l...
# ask-community
p
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
Hey @Pedro Machado, check this code snippet for how to do it.
p
Thanks, Kevin. Would I have to do this for every task? Is there a way to do it for the whole flow?
k
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.
👍 1
p
thanks!