changed add_to_log with the events API