https://prefect.io logo
Title
a

Alfie

08/20/2020, 7:08 AM
Hi all, seems the local agent execute a flow run in a separate process, I’d like to do some initializations at the very beginning of flow run, maybe right after the process is created . Is there any way to achieve that?
d

Dylan

08/20/2020, 1:43 PM
Hi @Alfie! What initializations do you have in mind? Does it make sense for them to occur in the first task of your flow?
a

Alfie

08/20/2020, 1:44 PM
thanks Dylan, I want to replace logger used in Prefect to comply with some standard, so some logger init code should be put there
d

Dylan

08/20/2020, 1:47 PM
Hmmmm
So I think there’s a “Prefect” way to create a custom logger
Do you want to replace the Prefect logger entirely because you want to stop sending logs to Prefect Cloud? I believe there’s a setting for that
a

Alfie

08/20/2020, 1:50 PM
not just that, i want to change format of the log too
d

Dylan

08/20/2020, 1:53 PM
Got it! So the doc I’ve linked above shows how to change the logs format
Let me find the setting to stop shipping logs to Cloud
Yup
So when you start or install your agent, you can pass
--no-cloud-logs
and Flows will not ship logs to Cloud
a

Alfie

08/20/2020, 2:01 PM
that’s great, much appriciated!
d

Dylan

08/20/2020, 2:01 PM
Anytime!