Add event logging functionality