Added logging of events