Fix bridge and event_loop. Log events to database.