Felix Tremblay

09/08/2022, 9:33 PM
Hi all, I was having issues with the logging in Prefect. I wanted to share my solution in case it helps someone else. Issue 1 - Prefect logger does not work outside of Prefect context Issue 2 - Prefect logger needs to have get_run_logger() in every functions Solution (proof-of-concept): See @Taylor Curran
🪵 3
blob attention gif 4
marvin 4
panda dancing 4

Taylor Curran

09/08/2022, 9:39 PM
Hi Felix! Thank you for sharing 🙂 Is the solution you outline in discourse working for you? Any blockers there?

Felix Tremblay

09/09/2022, 1:21 AM
Hi Taylor! Using "os.environ ... ", is a hacky way to make the logger visible to Prefect Cloud. I think that it won't be effective unless you already ran the file before. I don't know if there is a better way to change Prefect's settings from within python...

Anna Geller

09/09/2022, 1:35 AM
Thanks Felix for writing this up, I'll ask some engineers who know this better whether they could answer your questions
❤️ 1