Malthe Karbo

05/20/2022, 7:54 PM
When attaching a log handler (e.g., slack) to prefect logger, then whenever running a flow with dask, it will log multiple times with the handler - at least this is what we see with our implementation - Is there a good example for attaching a custom log handler to prefect orion logging?

Kevin Kho

05/20/2022, 7:55 PM
Could you show me a code sample?

Malthe Karbo

05/20/2022, 7:58 PM
I don't have a direct example which I can copy paste, but what we did was more or less use the following, and then made a function to get logger and called inside flows like this
def get_logger():
    logger = get_run_logger()
    return logger
Would make a better example but I am short on time right now (sorry!). I was just wondering if there existed a good example of writing a log handler specifically for orion (I assume that I have done something wrong) 🙂