second approach to logging: event-based