Unexpected behavior with logging when migrated to prefect2

When migrating from Prefect1 to Prefect2 I encountered a problem. Basically I call methods in Tasks and in those methods, I log my outputs to local .txt files.
When I run the flow with Prefect1 cloud, it works perfectly fine. But when I migrated to Prefect2 cloud, It doesn’t write logs to my local .txt files.
I tried so many things but none of them worked. Is there any possible solutions?

For example: I have some methods in task1.py in those methods I create some logs and I write those logs to a txt.

I am encountering the same problem when migrating from Prefect1 to Prefect2. I am logging to local disk the same way and I’ve been unable to find a solution that works. Were you able to find a solution?