Adding event logging