Dave D
11/03/2023, 6:48 PMMarvin
11/03/2023, 6:48 PMhandlers
section of the default logging.yml
shows the existing log handlers: the console
handler, and the prefect server
handler that sends logs to the API. You can add a new handler here for handling exceptions.
To send these exceptions to Slack, you can configure a notification in the Prefect server. Go to the Notifications page and select Create Notification or the + button. You can choose which run states should trigger a notification, tags to filter which flow runs are covered by the notification, and whether to send a Slack message. For Slack notifications, the configuration requires webhook credentials for your Slack and the channel to which the message is sent.
Here are the resources for more details:
- How to stream prefect logs to a file
- Prefect Notifications GuideDave D
11/03/2023, 6:50 PMDave D
11/03/2023, 6:50 PM@flow(on_failure=[notify_slack], retries=1)