Corris Randall
01/06/2022, 6:26 PMlogger = prefect.context.get('logger')
logger.setLevel(logging.DEBUG)
handler = graypy.GELFTLSHandler('10.11.12.13', 12345, fqdn=False, localname=os.environ.get('PREFECT_ENV'))
logger.addHandler(handler)
Kevin Kho
01/06/2022, 6:30 PMstored_as_script=True
in the Flow storage that the Flow is not serialized and this will be executed during runtime. You can also put this inside a task (but you might need to add it in every task if you do it that way). This will work because task execution is deferred so attaching the handler will happen during the flow run.Corris Randall
01/06/2022, 6:32 PMflow.storage = Local(
add_default_labels=False,
stored_as_script=True,path="/flows/"+os.path.basename( inspect.stack()[1][1] ),
)
Kevin Kho
01/06/2022, 6:57 PM