MDL-40050 webservice: Replace add_to_log() with new events