Corris Randall01/06/2022, 6:26 PM
logger = 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 Kho01/06/2022, 6:30 PM
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 Randall01/06/2022, 6:32 PM
flow.storage = Local( add_default_labels=False, stored_as_script=True,path="/flows/"+os.path.basename( inspect.stack() ), )
Kevin Kho01/06/2022, 6:57 PM