writing to log as soon as event is recorded