Write to the log file once per event