introduce an event handler for alerting and logging