This code handles generating logging messages for the event and any error that may occur during the processing of the notification.