Added logging to events for easier debugging