log and add documents